This commit is contained in:
Timothy Jaeryang Baek
2025-11-27 08:07:39 -05:00
parent 560702a8f7
commit 6bb204eb80
3 changed files with 8 additions and 3 deletions
+3 -1
View File
@@ -5,7 +5,7 @@
import { onDestroy, onMount, tick } from 'svelte';
import { goto } from '$app/navigation';
import { chatId, showSidebar, socket, user } from '$lib/stores';
import { chatId, channelId as _channelId, showSidebar, socket, user } from '$lib/stores';
import { getChannelById, getChannelMessages, sendMessage } from '$lib/apis/channels';
import Messages from './Messages.svelte';
@@ -62,6 +62,7 @@
currentId = id;
updateLastReadAt(id);
_channelId.set(id);
top = false;
messages = null;
@@ -220,6 +221,7 @@
onDestroy(() => {
// last read at
updateLastReadAt(id);
_channelId.set(null);
$socket?.off('events:channel', channelEventHandler);
});
</script>