From 76672789cfd74f069f80c96bb0cfaec91160d6a2 Mon Sep 17 00:00:00 2001
From: Piotr 'pwh' Hanusiak
Date: Thu, 21 Apr 2022 09:30:48 +0200
Subject: [PATCH] listen to silentStore instead of statusStore when no other
statuses are needed
---
front/src/Api/desktop/index.ts | 7 +++----
front/src/Components/CameraControls.svelte | 7 +++----
front/src/Components/MyCamera.svelte | 7 +++----
3 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/front/src/Api/desktop/index.ts b/front/src/Api/desktop/index.ts
index 5c380ffd..6e38403c 100644
--- a/front/src/Api/desktop/index.ts
+++ b/front/src/Api/desktop/index.ts
@@ -1,7 +1,6 @@
-import { availabilityStatusStore, requestedCameraState, requestedMicrophoneState } from "../../Stores/MediaStore";
+import { requestedCameraState, requestedMicrophoneState, silentStore } from "../../Stores/MediaStore";
import { get } from "svelte/store";
import { WorkAdventureDesktopApi } from "@wa-preload-app";
-import { AvailabilityStatus } from "../../Messages/ts-proto-generated/protos/messages";
declare global {
interface Window {
@@ -37,8 +36,8 @@ class DesktopApi {
}
});
- availabilityStatusStore.subscribe((status) => {
- this.isSilent = status === AvailabilityStatus.SILENT;
+ silentStore.subscribe((silent) => {
+ this.isSilent = silent;
});
}
}
diff --git a/front/src/Components/CameraControls.svelte b/front/src/Components/CameraControls.svelte
index 31b8dea6..8b617f2e 100644
--- a/front/src/Components/CameraControls.svelte
+++ b/front/src/Components/CameraControls.svelte
@@ -1,6 +1,6 @@
diff --git a/front/src/Components/MyCamera.svelte b/front/src/Components/MyCamera.svelte
index 8ddda1a9..8f4b2094 100644
--- a/front/src/Components/MyCamera.svelte
+++ b/front/src/Components/MyCamera.svelte
@@ -1,11 +1,10 @@