fix: call mode persisting after width change issue

This commit is contained in:
Timothy J. Baek
2024-09-26 21:45:19 +02:00
parent 8204f06485
commit 1715446b13
2 changed files with 48 additions and 32 deletions
+14 -2
View File
@@ -2,7 +2,7 @@
import { SvelteFlowProvider } from '@xyflow/svelte';
import { slide } from 'svelte/transition';
import { onDestroy, onMount } from 'svelte';
import { onDestroy, onMount, tick } from 'svelte';
import { mobile, showControls, showCallOverlay, showOverview } from '$lib/stores';
import Modal from '../common/Modal.svelte';
@@ -35,11 +35,23 @@
// listen to resize 1024px
const mediaQuery = window.matchMedia('(min-width: 1024px)');
const handleMediaQuery = (e) => {
const handleMediaQuery = async (e) => {
if (e.matches) {
largeScreen = true;
if ($showCallOverlay) {
showCallOverlay.set(false);
await tick();
showCallOverlay.set(true);
}
} else {
largeScreen = false;
if ($showCallOverlay) {
showCallOverlay.set(false);
await tick();
showCallOverlay.set(true);
}
pane = null;
}
};