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

View file

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