Compare commits

..

No commits in common. "ec7de22dca41221159dd86131cbf8f2689080715" and "d1654546fa8abd8ab69b3597ac234c78e92b2ea9" have entirely different histories.

5 changed files with 7 additions and 23 deletions

View file

@ -28,7 +28,6 @@
.message-content {
color: var(--foreground-color-2);
white-space: pre-wrap;
}
.pending {

View file

@ -44,14 +44,10 @@
};
const onKeydown = async (e) => {
if (e.code === "Enter") {
if (e.shiftKey) {
return;
} else {
e.preventDefault();
await sendMessage();
}
}
if (e.code !== "Enter")
return;
await sendMessage();
};
</script>
@ -86,13 +82,13 @@
</style>
<div class="message-input-container">
<textarea
<input
placeholder={`Send something interesting to #${channel.name}`}
type="text"
class="message-input"
on:keydown={ onKeydown }
bind:value={ messageInput }
/>
>
{#if $smallViewport}
<button class="icon-button send-button" on:click="{ sendMessage }">
<SendIcon />

View file

@ -224,9 +224,6 @@ class MessageStore extends Store {
}
async loadOlderMessages(beforeCommitToStore=null) {
if (this.channelId === -1)
return;
const oldestMessage = this.value[0];
const endpoint = oldestMessage ? `channels/${this.channelId}/messages/?before=${oldestMessage.id}` : `channels/${this.channelId}/messages`;
const res = await request("GET", apiRoute(endpoint), true, null);
@ -301,14 +298,11 @@ class OverlayStore extends Store {
toast: null,
login: null,
createAccount: null,
editMessage: null,
settings: null,
settings: null
}, "OverlayStore");
}
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.updated();
}

View file

@ -17,5 +17,4 @@ export const gatewayErrors = {
ALREADY_AUTHENTICATED: { code: 4006, message: "Already authenticated" },
PAYLOAD_TOO_LARGE: { code: 4007, message: "Payload too large" },
TOO_MANY_SESSIONS: { code: 4008, message: "Too many sessions" },
NOT_AUTHENTICATED: { code: 4009, message: "Not authenticated" },
};

View file

@ -245,10 +245,6 @@ export default function(server: Server) {
return closeWithBadPayload(ws, "d: expected numeric '0'");
}
if (!ws.state.ready) {
return closeWithError(ws, gatewayErrors.NOT_AUTHENTICATED);
}
// TODO: also check session here
ws.state.alive = true;
break;