Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Perspective handle's state was not updated when the instance state got updated which caused the issue #368

Merged
merged 2 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions executor/src/core/PerspectivesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
Expand Down