diff --git a/front/src/Components/CameraControls.svelte b/front/src/Components/CameraControls.svelte index 8b617f2e..fad3c3c1 100644 --- a/front/src/Components/CameraControls.svelte +++ b/front/src/Components/CameraControls.svelte @@ -13,7 +13,6 @@ import lockImg from "./images/lock.svg"; import { LayoutMode } from "../WebRtc/LayoutManager"; import { peerStore } from "../Stores/PeerStore"; - import { onDestroy } from "svelte"; import { embedScreenLayout } from "../Stores/EmbedScreensStore"; import { followRoleStore, followStateStore, followUsersStore } from "../Stores/FollowStore"; import { gameManager } from "../Phaser/Game/GameManager"; @@ -22,7 +21,7 @@ const gameScene = gameManager.getCurrentGameScene(); function screenSharingClick(): void { - if (isSilent) return; + if ($silentStore) return; if ($requestedScreenSharingState === true) { requestedScreenSharingState.disableScreenSharing(); } else { @@ -31,7 +30,7 @@ } function cameraClick(): void { - if (isSilent) return; + if ($silentStore) return; if ($requestedCameraState === true) { requestedCameraState.disableWebcam(); } else { @@ -40,7 +39,7 @@ } function microphoneClick(): void { - if (isSilent) return; + if ($silentStore) return; if ($requestedMicrophoneState === true) { requestedMicrophoneState.disableMicrophone(); } else { @@ -75,12 +74,6 @@ function lockClick() { gameScene.connection?.emitLockGroup(!$currentPlayerGroupLockStateStore); } - - let isSilent: boolean; - const unsubscribeIsSilent = silentStore.subscribe((silent) => { - isSilent = silent; - }); - onDestroy(unsubscribeIsSilent);