Compare commits
No commits in common. "ec7de22dca41221159dd86131cbf8f2689080715" and "d1654546fa8abd8ab69b3597ac234c78e92b2ea9" have entirely different histories.
ec7de22dca
...
d1654546fa
5 changed files with 7 additions and 23 deletions
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
.message-content {
|
.message-content {
|
||||||
color: var(--foreground-color-2);
|
color: var(--foreground-color-2);
|
||||||
white-space: pre-wrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.pending {
|
.pending {
|
||||||
|
|
|
@ -44,14 +44,10 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
const onKeydown = async (e) => {
|
const onKeydown = async (e) => {
|
||||||
if (e.code === "Enter") {
|
if (e.code !== "Enter")
|
||||||
if (e.shiftKey) {
|
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
e.preventDefault();
|
|
||||||
await sendMessage();
|
await sendMessage();
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -86,13 +82,13 @@
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="message-input-container">
|
<div class="message-input-container">
|
||||||
<textarea
|
<input
|
||||||
placeholder={`Send something interesting to #${channel.name}`}
|
placeholder={`Send something interesting to #${channel.name}`}
|
||||||
type="text"
|
type="text"
|
||||||
class="message-input"
|
class="message-input"
|
||||||
on:keydown={ onKeydown }
|
on:keydown={ onKeydown }
|
||||||
bind:value={ messageInput }
|
bind:value={ messageInput }
|
||||||
/>
|
>
|
||||||
{#if $smallViewport}
|
{#if $smallViewport}
|
||||||
<button class="icon-button send-button" on:click="{ sendMessage }">
|
<button class="icon-button send-button" on:click="{ sendMessage }">
|
||||||
<SendIcon />
|
<SendIcon />
|
||||||
|
|
|
@ -224,9 +224,6 @@ class MessageStore extends Store {
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadOlderMessages(beforeCommitToStore=null) {
|
async loadOlderMessages(beforeCommitToStore=null) {
|
||||||
if (this.channelId === -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const oldestMessage = this.value[0];
|
const oldestMessage = this.value[0];
|
||||||
const endpoint = oldestMessage ? `channels/${this.channelId}/messages/?before=${oldestMessage.id}` : `channels/${this.channelId}/messages`;
|
const endpoint = oldestMessage ? `channels/${this.channelId}/messages/?before=${oldestMessage.id}` : `channels/${this.channelId}/messages`;
|
||||||
const res = await request("GET", apiRoute(endpoint), true, null);
|
const res = await request("GET", apiRoute(endpoint), true, null);
|
||||||
|
@ -301,14 +298,11 @@ class OverlayStore extends Store {
|
||||||
toast: null,
|
toast: null,
|
||||||
login: null,
|
login: null,
|
||||||
createAccount: null,
|
createAccount: null,
|
||||||
editMessage: null,
|
settings: null
|
||||||
settings: null,
|
|
||||||
}, "OverlayStore");
|
}, "OverlayStore");
|
||||||
}
|
}
|
||||||
|
|
||||||
open(name, props={}) {
|
open(name, props={}) {
|
||||||
if (this.value[name] === undefined)
|
|
||||||
throw new Error(`OverlayStore.open: tried to open unknown overlay with name '${name}' (undefined in overlay map)`);
|
|
||||||
this.value[name] = props;
|
this.value[name] = props;
|
||||||
this.updated();
|
this.updated();
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,5 +17,4 @@ export const gatewayErrors = {
|
||||||
ALREADY_AUTHENTICATED: { code: 4006, message: "Already authenticated" },
|
ALREADY_AUTHENTICATED: { code: 4006, message: "Already authenticated" },
|
||||||
PAYLOAD_TOO_LARGE: { code: 4007, message: "Payload too large" },
|
PAYLOAD_TOO_LARGE: { code: 4007, message: "Payload too large" },
|
||||||
TOO_MANY_SESSIONS: { code: 4008, message: "Too many sessions" },
|
TOO_MANY_SESSIONS: { code: 4008, message: "Too many sessions" },
|
||||||
NOT_AUTHENTICATED: { code: 4009, message: "Not authenticated" },
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -245,10 +245,6 @@ export default function(server: Server) {
|
||||||
return closeWithBadPayload(ws, "d: expected numeric '0'");
|
return closeWithBadPayload(ws, "d: expected numeric '0'");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ws.state.ready) {
|
|
||||||
return closeWithError(ws, gatewayErrors.NOT_AUTHENTICATED);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: also check session here
|
// TODO: also check session here
|
||||||
ws.state.alive = true;
|
ws.state.alive = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue