make sure responsive handlers are initialized before gateway settlement

This commit is contained in:
hippoz 2022-09-20 18:19:11 +03:00
parent 3bde9249c7
commit cb0a7330b6
No known key found for this signature in database
GPG key ID: 7C52899193467641
2 changed files with 10 additions and 23 deletions

View file

@ -28,26 +28,14 @@
{/if}
</svelte:head>
<style>
.flex-container {
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
overflow: hidden;
}
</style>
<OverlayProvider />
<div class="flex-container">
{#if !($smallViewport && $showPresenceSidebar) && $showSidebar || $selectedChannel.id === -1}
<Sidebar />
{/if}
{#if !($smallViewport && $showSidebar) && !($smallViewport && $showPresenceSidebar) && $showChannelView && $selectedChannel.id !== -1}
<ChannelView channel={$selectedChannel} />
{/if}
{#if $showPresenceSidebar}
<PresenceSidebar />
{/if}
</div>
{#if !($smallViewport && $showPresenceSidebar) && $showSidebar || $selectedChannel.id === -1}
<Sidebar />
{/if}
{#if !($smallViewport && $showSidebar) && !($smallViewport && $showPresenceSidebar) && $showChannelView && $selectedChannel.id !== -1}
<ChannelView channel={$selectedChannel} />
{/if}
{#if $showPresenceSidebar}
<PresenceSidebar />
{/if}

View file

@ -8,8 +8,6 @@ import gateway, { GatewayEventType } from './gateway';
import "@material-design-icons/font";
function handleGatewaySettlement() {
initResponsiveHandlers();
const loadingElement = document.getElementById("pre--loading-screen");
if (loadingElement) {
loadingElement.parentElement.removeChild(loadingElement);
@ -27,6 +25,7 @@ function handleGatewaySettlement() {
function main() {
useDebuggingApi();
useAuthHandlers();
initResponsiveHandlers();
gateway.subscribe(GatewayEventType.Ready, handleGatewaySettlement);
gateway.subscribe(GatewayEventType.Close, handleGatewaySettlement);