diff --git a/CHANGELOG b/CHANGELOG index af135f362..0135d6af3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,7 @@ This project _loosely_ adheres to [Semantic Versioning](https://semver.org/spec/ ### Fixed - Expression -> get would fail when executed on a Literal expression. [PR#353](https://github.com/perspect3vism/ad4m/pull/353) - Fixed launcher breaking on windows if a new app instance is created. [PR#362](https://github.com/perspect3vism/ad4m/pull/362) + - Fixed Perspective handle's state was not updated when the instance state got updated which caused the issue. [PR#368](https://github.com/perspect3vism/ad4m/pull/368) ## [0.3.4] - 27/03/2023 ### Added diff --git a/executor/src/core/PerspectivesController.ts b/executor/src/core/PerspectivesController.ts index c9ef67a8f..5ceefaedd 100644 --- a/executor/src/core/PerspectivesController.ts +++ b/executor/src/core/PerspectivesController.ts @@ -79,8 +79,10 @@ export default class PerspectivesController { this.#context.languageController!.addSyncStateChangeObserver(async (state: PerspectiveState, lang: LanguageRef) => { let perspective = Array.from(this.#perspectiveInstances.values()).find((perspective: Perspective) => perspective.neighbourhood?.linkLanguage === lang.address); + let perspectiveHandle = Array.from(this.#perspectiveHandles.values()).find((p) => p.uuid === perspective?.uuid); if (perspective) { await perspective.updatePerspectiveState(state); + perspectiveHandle!.state = state; } else { console.warn(`Could not find perspective sync state change signal with lang: ${lang}`) }