From 2e2e3980ab78052be74f4007c343e69a583648fe Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Thu, 10 Oct 2024 22:30:18 -0400
Subject: Compute the active channel from the current routing state, not from a
 store.

---
 ui/lib/components/ChannelList.svelte | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

(limited to 'ui/lib/components/ChannelList.svelte')

diff --git a/ui/lib/components/ChannelList.svelte b/ui/lib/components/ChannelList.svelte
index e0e5f06..316e404 100644
--- a/ui/lib/components/ChannelList.svelte
+++ b/ui/lib/components/ChannelList.svelte
@@ -2,17 +2,15 @@
     import { channelsList } from '$lib/store';
     import Channel from './Channel.svelte';
 
-    let channels;
+    export let active = null;
 
-    channelsList.subscribe((value) => {
-        channels = value.channels;
-    });
+    $: channels = $channelsList.channels;
 </script>
 
 <nav class="list-nav">
     <ul>
         {#each channels as channel}
-            <Channel {...channel} />
+            <Channel {...channel} active={active === channel.id} />
         {/each}
     </ul>
 </nav>
-- 
cgit v1.2.3

