summaryrefslogtreecommitdiff
path: root/ui/lib/components/ChannelList.svelte
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-10 22:30:18 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-10 23:08:36 -0400
commit2e2e3980ab78052be74f4007c343e69a583648fe (patch)
treee791f18ee018a504db6da4939a8b82d1d84fe725 /ui/lib/components/ChannelList.svelte
parent1798988c5bc6ad8c2286848df14c7fa478e135d1 (diff)
Compute the active channel from the current routing state, not from a store.
Diffstat (limited to 'ui/lib/components/ChannelList.svelte')
-rw-r--r--ui/lib/components/ChannelList.svelte8
1 files changed, 3 insertions, 5 deletions
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>