frontend: fix behavior when no channels are present
This commit is contained in:
parent
34dc98af95
commit
6cfac8a6aa
2 changed files with 5 additions and 3 deletions
|
@ -26,10 +26,10 @@
|
|||
{/if}
|
||||
|
||||
<div class="flex-container">
|
||||
{#if $showSidebar}
|
||||
{#if $showSidebar || $selectedChannel.id === -1}
|
||||
<Sidebar />
|
||||
{/if}
|
||||
{#if !($smallViewport && $showSidebar) && $showChannelView}
|
||||
{#if !($smallViewport && $showSidebar) && $showChannelView && $selectedChannel.id !== -1}
|
||||
<ChannelView channel={$selectedChannel} />
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue