diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 1ef034dd..66a2d8eb 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -76,7 +76,7 @@ import { userIsAdminStore } from "../../Stores/GameStore"; import { contactPageStore } from "../../Stores/MenuStore"; import type { WasCameraUpdatedEvent } from "../../Api/Events/WasCameraUpdatedEvent"; import { audioManagerFileStore } from "../../Stores/AudioManagerStore"; -import { currentPlayerGroupIdStore, currentPlayerGroupLockStateStore } from "../../Stores/CurrentPlayerGroupStore"; +import { currentPlayerGroupLockStateStore } from "../../Stores/CurrentPlayerGroupStore"; import EVENT_TYPE = Phaser.Scenes.Events; import Texture = Phaser.Textures.Texture; @@ -711,10 +711,6 @@ export class GameScene extends DirtyScene { } }); - this.currentPlayerGroupIdStoreUnsubscribe = currentPlayerGroupIdStore.subscribe((groupId) => { - this.currentPlayerGroupId = groupId; - }); - Promise.all([ this.connectionAnswerPromiseDeferred.promise as Promise, ...scriptPromises, @@ -847,8 +843,7 @@ export class GameScene extends DirtyScene { }); this.connection.groupUsersUpdateMessageStream.subscribe((message) => { - // TODO: how else can we deduce our current group? - currentPlayerGroupIdStore.set(message.groupId); + this.currentPlayerGroupId = message.groupId; }); /** @@ -1870,7 +1865,6 @@ ${escapedMessage} break; case "DeleteGroupEvent": { this.doDeleteGroup(event.groupId); - currentPlayerGroupIdStore.set(undefined); currentPlayerGroupLockStateStore.set(undefined); break; } diff --git a/front/src/Stores/CurrentPlayerGroupStore.ts b/front/src/Stores/CurrentPlayerGroupStore.ts index cda46325..91d4b50e 100644 --- a/front/src/Stores/CurrentPlayerGroupStore.ts +++ b/front/src/Stores/CurrentPlayerGroupStore.ts @@ -1,4 +1,3 @@ import { writable } from "svelte/store"; -export const currentPlayerGroupIdStore = writable(undefined); export const currentPlayerGroupLockStateStore = writable(undefined);