summaryrefslogtreecommitdiff
path: root/hi-ui/src/routes/(app)
diff options
context:
space:
mode:
authorKit La Touche <kit@transneptune.net>2024-10-09 15:40:32 -0400
committerKit La Touche <kit@transneptune.net>2024-10-09 15:40:32 -0400
commit84a672d6b63122b9732bc826d92a47bae97f2b25 (patch)
treeac35f32cecd73833cb5f615a8aa974f6b2103ee8 /hi-ui/src/routes/(app)
parentbd53a51af835478d23bef4772ce7e50553dc3fdf (diff)
Fix up on-navigation data loading
Maybe this isn't ideal, but whatever.
Diffstat (limited to 'hi-ui/src/routes/(app)')
-rw-r--r--hi-ui/src/routes/(app)/ch/[channel]/+page.js13
-rw-r--r--hi-ui/src/routes/(app)/ch/[channel]/+page.svelte12
2 files changed, 12 insertions, 13 deletions
diff --git a/hi-ui/src/routes/(app)/ch/[channel]/+page.js b/hi-ui/src/routes/(app)/ch/[channel]/+page.js
deleted file mode 100644
index 5fd493a..0000000
--- a/hi-ui/src/routes/(app)/ch/[channel]/+page.js
+++ /dev/null
@@ -1,13 +0,0 @@
-export const ssr = false;
-
-import { activeChannel } from '$lib/store';
-
-
-/** @type {import('./$types').PageLoad} */
-export function load({ params }) {
- let { channel } = params;
- activeChannel.update((value) => {
- value.set(channel)
- return value;
- });
-}
diff --git a/hi-ui/src/routes/(app)/ch/[channel]/+page.svelte b/hi-ui/src/routes/(app)/ch/[channel]/+page.svelte
index 26b493e..ef439d0 100644
--- a/hi-ui/src/routes/(app)/ch/[channel]/+page.svelte
+++ b/hi-ui/src/routes/(app)/ch/[channel]/+page.svelte
@@ -1,5 +1,17 @@
<script>
+ import { afterNavigate } from '$app/navigation';
+ import { page } from '$app/stores';
+
+ import { activeChannel } from '$lib/store';
import ActiveChannel from '$lib/components/ActiveChannel.svelte';
+
+ afterNavigate(async () => {
+ let { channel } = $page.params;
+ activeChannel.update((value) => {
+ value.set(channel)
+ return value;
+ });
+ });
</script>
<ActiveChannel />