diff --git a/src/lib/components/channel/Channel.svelte b/src/lib/components/channel/Channel.svelte index 65bc6900b..73f418c1d 100644 --- a/src/lib/components/channel/Channel.svelte +++ b/src/lib/components/channel/Channel.svelte @@ -109,35 +109,38 @@ ? 'md:max-w-[calc(100%-260px)]' : ''} w-full max-w-full flex flex-col" > - {#if channel} - -
{ - scrollEnd = Math.abs(messagesContainerElement.scrollTop) <= 50; - }} - > - {#key id} - { - const newMessages = await getChannelMessages(localStorage.token, id, messages.length); + - messages = [...messages, ...newMessages]; +
+ {#if channel} +
{ + scrollEnd = Math.abs(messagesContainerElement.scrollTop) <= 50; + }} + > + {#key id} + { + const newMessages = await getChannelMessages(localStorage.token, id, messages.length); - if (newMessages.length < 50) { - top = true; - return; - } - }} - /> - {/key} -
- {/if} + messages = [...messages, ...newMessages]; + + if (newMessages.length < 50) { + top = true; + return; + } + }} + /> + {/key} +
+ {/if} +
diff --git a/src/lib/components/channel/Navbar.svelte b/src/lib/components/channel/Navbar.svelte index e55aeacf3..ccb43a16b 100644 --- a/src/lib/components/channel/Navbar.svelte +++ b/src/lib/components/channel/Navbar.svelte @@ -47,9 +47,11 @@ {$showSidebar ? 'ml-1' : ''} " > -
- {channel.name} -
+ {#if channel} +
+ {channel.name} +
+ {/if}