diff options
Diffstat (limited to 'hi-ui/src/routes/(app)/+layout.svelte')
| -rw-r--r-- | hi-ui/src/routes/(app)/+layout.svelte | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/hi-ui/src/routes/(app)/+layout.svelte b/hi-ui/src/routes/(app)/+layout.svelte index 9875817..ae6195d 100644 --- a/hi-ui/src/routes/(app)/+layout.svelte +++ b/hi-ui/src/routes/(app)/+layout.svelte @@ -2,7 +2,7 @@ import { onMount } from 'svelte'; import { boot, subscribeToEvents } from '$lib/apiServer'; - import { currentUser, channelsList, messages } from '$lib/store'; + import { currentUser, logins, channelsList, messages } from '$lib/store'; import ChannelList from '$lib/components/ChannelList.svelte'; import CreateChannelForm from '$lib/components/CreateChannelForm.svelte'; @@ -21,15 +21,9 @@ id: boot.login.id, username: boot.login.name, })); - let channels = boot.channels.map((channel) => ({ - id: channel.id, - name: channel.name, - })); - channelsList.update((value) => value.setChannels(channels)); - let bootMessages = boot.channels.map((channel) => [channel.id, channel.messages]); - for (let [channel, channelMessages] of bootMessages) { - messages.update((value) => value.addMessages(channel, channelMessages)); - } + logins.update((value) => value.setLogins(boot.logins)); + channelsList.update((value) => value.setChannels(boot.channels)); + messages.update((value) => value.setMessages(boot.messages)); } onMount(async () => { @@ -37,6 +31,7 @@ let response = await boot(); switch (response.status) { case 200: + debugger; onBooted(response.data); subscribeToEvents(response.data.resume_point); break; |
