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);
@@ -94,7 +87,7 @@
@@ -103,7 +96,7 @@
@@ -113,26 +106,26 @@
- {#if $requestedScreenSharingState && !isSilent} + {#if $requestedScreenSharingState && !$silentStore} Start screen sharing {:else} Stop screen sharing {/if}
-
- {#if $requestedCameraState && !isSilent} +
+ {#if $requestedCameraState && !$silentStore} Turn on webcam {:else} Turn off webcam {/if}
-
- {#if $requestedMicrophoneState && !isSilent} +
+ {#if $requestedMicrophoneState && !$silentStore} Turn on microphone {:else} Turn off microphone diff --git a/front/src/Components/MyCamera.svelte b/front/src/Components/MyCamera.svelte index 8f4b2094..d72a8eee 100644 --- a/front/src/Components/MyCamera.svelte +++ b/front/src/Components/MyCamera.svelte @@ -20,11 +20,6 @@ unsubscribeLocalStreamStore(); }); - let isSilent: boolean; - const unsubscribeIsSilent = silentStore.subscribe((silent) => { - isSilent = silent; - }); - let cameraContainer: HTMLDivElement; onMount(() => { @@ -40,16 +35,14 @@ } }); }); - - onDestroy(unsubscribeIsSilent);
- {#if isSilent} + {#if $silentStore}
{$LL.camera.my.silentZone()}
{:else if $localStreamStore.type === "success" && $localStreamStore.stream}