summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2025-02-21 17:07:35 -0500
committerOwen Jacobson <owen@grimoire.ca>2025-02-21 17:07:35 -0500
commit25daf36b18086096651b381223ad8f03fbca5045 (patch)
tree41f5efc395852b0bcf4cc79130113e26bd4bb72a
parent75aa3b41cbf1c41ce08f307a12a1f101cb357f29 (diff)
Retire use of $page store in favour of Sv5 page state
-rw-r--r--ui/routes/(app)/+layout.svelte4
-rw-r--r--ui/routes/(app)/ch/[channel]/+page.svelte5
2 files changed, 5 insertions, 4 deletions
diff --git a/ui/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte
index a81efce..6339abd 100644
--- a/ui/routes/(app)/+layout.svelte
+++ b/ui/routes/(app)/+layout.svelte
@@ -1,5 +1,5 @@
<script>
- import { page } from '$app/stores';
+ import { page } from '$app/state';
import { goto } from '$app/navigation';
import { browser } from '$app/environment';
import { getContext, onDestroy, onMount } from 'svelte';
@@ -17,7 +17,7 @@
let pageContext = getContext('page');
let { children } = $props();
let loading = $state(true);
- let channel = $derived($page.params.channel);
+ let channel = $derived(page.params.channel);
let rawChannels = $derived($channelsList.channels);
let rawMessages = $derived($messages);
diff --git a/ui/routes/(app)/ch/[channel]/+page.svelte b/ui/routes/(app)/ch/[channel]/+page.svelte
index 9335198..84cb0ae 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 { channelsList, messages } from '$lib/store';
- let channel = $derived($page.params.channel);
+ let channel = $derived(page.params.channel);
let messageRuns = $derived($messages.inChannel(channel));
let activeChannel;
@@ -58,6 +58,7 @@
}
let lastReadCallback = null;
+
function onscroll() {
clearTimeout(lastReadCallback); // Fine if lastReadCallback is null still.
lastReadCallback = setTimeout(setLastRead, 2 * 1000);