diff --git a/frontend/src/components/Main.svelte b/frontend/src/components/Main.svelte
index 3d91135..2107dd6 100644
--- a/frontend/src/components/Main.svelte
+++ b/frontend/src/components/Main.svelte
@@ -26,10 +26,10 @@
{/if}
- {#if $showSidebar}
+ {#if $showSidebar || $selectedChannel.id === -1}
{/if}
- {#if !($smallViewport && $showSidebar) && $showChannelView}
+ {#if !($smallViewport && $showSidebar) && $showChannelView && $selectedChannel.id !== -1}
{/if}
diff --git a/frontend/src/stores.js b/frontend/src/stores.js
index 057e9aa..6e6b1e8 100644
--- a/frontend/src/stores.js
+++ b/frontend/src/stores.js
@@ -36,7 +36,9 @@ class ChannelsStore extends Store {
gateway.subscribe(GatewayEventType.Ready, ({ channels }) => {
this.value = channels;
- selectedChannel.set(channels.length ? channels[0] : null);
+ if (channels.length >= 1) {
+ selectedChannel.set(channels[0]);
+ }
this.updated();
});
gateway.subscribe(GatewayEventType.ChannelCreate, (channel) => {