diff options
| author | Kit La Touche <kit@transneptune.net> | 2025-02-21 22:18:56 -0500 |
|---|---|---|
| committer | Kit La Touche <kit@transneptune.net> | 2025-02-21 22:53:49 -0500 |
| commit | 9d1dbac74866a6175c65a25bbd8a3ccbe8cf87e4 (patch) | |
| tree | f15b3f0695b948e335774aa4d92a5b064a1c0f10 /ui/routes/(app)/ch | |
| parent | 743b59b69857da81b214970ec9252bc918ad243d (diff) | |
| parent | 36cadfe00cacc6a6523f9862d3f7a08a9d0ce611 (diff) | |
Merge branch 'main' into prop/preserve-state
Diffstat (limited to 'ui/routes/(app)/ch')
| -rw-r--r-- | ui/routes/(app)/ch/[channel]/+page.svelte | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/routes/(app)/ch/[channel]/+page.svelte b/ui/routes/(app)/ch/[channel]/+page.svelte index 25bc318..54ebda7 100644 --- a/ui/routes/(app)/ch/[channel]/+page.svelte +++ b/ui/routes/(app)/ch/[channel]/+page.svelte @@ -1,11 +1,11 @@ <script> import { DateTime } from 'luxon'; - import { page } from '$app/stores'; + import { page } from '$app/state'; import ActiveChannel from '$lib/components/ActiveChannel.svelte'; import MessageInput from '$lib/components/MessageInput.svelte'; import { channelsMetaList, messages } from '$lib/store'; - let channel = $derived($page.params.channel); + let channel = $derived(page.params.channel); let messageRuns = $derived($messages.inChannel(channel)); let activeChannel; @@ -53,7 +53,8 @@ } let lastReadCallback = null; - function handleScroll() { + + function onscroll() { clearTimeout(lastReadCallback); // Fine if lastReadCallback is null still. lastReadCallback = setTimeout(setLastRead, 2 * 1000); } @@ -61,7 +62,7 @@ <svelte:window onkeydown={handleKeydown} /> -<div class="active-channel" on:scroll={handleScroll} bind:this={activeChannel}> +<div class="active-channel" {onscroll} bind:this={activeChannel}> <ActiveChannel {messageRuns} /> </div> <div class="create-message"> |
