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/routes/(app)/+layout.svelte | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'ui/routes/(app)/+layout.svelte')

diff --git a/ui/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte
index f8744c1..1d561ae 100644
--- a/ui/routes/(app)/+layout.svelte
+++ b/ui/routes/(app)/+layout.svelte
@@ -1,5 +1,6 @@
 <script>
 	import { onMount } from 'svelte';
+    import { page } from '$app/stores';
 
 	import { boot, subscribeToEvents } from '$lib/apiServer';
 	import { currentUser, logins, channelsList, messages } from '$lib/store';
@@ -11,6 +12,7 @@
 
     let user;
     let loading = true;
+    $: channel = $page?.params?.channel;
 
     currentUser.subscribe((value) => {
         user = value;
@@ -53,7 +55,7 @@
 {:else if user != null}
     <div id="interface">
         <div class="channel-list">
-            <ChannelList />
+            <ChannelList active={channel} />
         </div>
         <div class="active-channel">
             <slot />
@@ -62,7 +64,7 @@
             <CreateChannelForm />
         </div>
         <div class="create-message">
-            <MessageInput />
+            <MessageInput {channel} />
         </div>
     </div>
 {:else}
-- 
cgit v1.2.3

