From c6d445bd977d5aad5052240e5075c5ab002c8c1a Mon Sep 17 00:00:00 2001
From: Piotr 'pwh' Hanusiak
Date: Wed, 20 Apr 2022 16:49:16 +0200
Subject: [PATCH] get rid of awayStore as it is now the same as
privacyShutdownStore
---
front/src/Phaser/Game/GameScene.ts | 7 +------
front/src/Stores/MediaStore.ts | 7 +++----
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts
index 47efbccb..c79f8f43 100644
--- a/front/src/Phaser/Game/GameScene.ts
+++ b/front/src/Phaser/Game/GameScene.ts
@@ -91,7 +91,7 @@ import { MapStore } from "../../Stores/Utils/MapStore";
import { followUsersColorStore } from "../../Stores/FollowStore";
import { GameSceneUserInputHandler } from "../UserInput/GameSceneUserInputHandler";
import { locale } from "../../i18n/i18n-svelte";
-import { availabilityStatusStore, awayStore, localVolumeStore } from "../../Stores/MediaStore";
+import { availabilityStatusStore, localVolumeStore } from "../../Stores/MediaStore";
import { StringUtils } from "../../Utils/StringUtils";
import { startLayerNamesStore } from "../../Stores/StartLayerNamesStore";
import { JitsiCoWebsite } from "../../WebRtc/CoWebsite/JitsiCoWebsite";
@@ -101,7 +101,6 @@ import CancelablePromise from "cancelable-promise";
import { Deferred } from "ts-deferred";
import { SuperLoaderPlugin } from "../Services/SuperLoaderPlugin";
import { PlayerDetailsUpdatedMessage } from "../../Messages/ts-proto-generated/protos/messages";
-import { privacyShutdownStore } from "../../Stores/PrivacyShutdownStore";
export interface GameSceneInitInterface {
initPosition: PointInterface | null;
reconnecting: boolean;
@@ -712,10 +711,6 @@ export class GameScene extends DirtyScene {
}
});
- this.privacyShutdownStoreUnsubscribe = privacyShutdownStore.subscribe((away) => {
- awayStore.set(away);
- });
-
Promise.all([
this.connectionAnswerPromiseDeferred.promise as Promise,
...scriptPromises,
diff --git a/front/src/Stores/MediaStore.ts b/front/src/Stores/MediaStore.ts
index 269e90fa..dc0680dc 100644
--- a/front/src/Stores/MediaStore.ts
+++ b/front/src/Stores/MediaStore.ts
@@ -182,14 +182,13 @@ function createVideoConstraintStore() {
export const inJitsiStore = writable(false);
export const silentStore = writable(false);
-export const awayStore = writable(false);
export const availabilityStatusStore = derived(
- [inJitsiStore, silentStore, awayStore],
- ([$inJitsiStore, $silentStore, $awayStore]) => {
+ [inJitsiStore, silentStore, privacyShutdownStore],
+ ([$inJitsiStore, $silentStore, $privacyShutdownStore]) => {
if ($inJitsiStore) return AvailabilityStatus.JITSI;
if ($silentStore) return AvailabilityStatus.SILENT;
- if ($awayStore) return AvailabilityStatus.AWAY;
+ if ($privacyShutdownStore) return AvailabilityStatus.AWAY;
return AvailabilityStatus.ONLINE;
},
AvailabilityStatus.ONLINE