From 2a2d3e7b808b6713eb29d4255ce27a2582eda82f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 20 Apr 2022 10:45:39 +0100 Subject: [PATCH] Fix RightPanelStore handling first room on app launch wrong --- src/stores/right-panel/RightPanelStore.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stores/right-panel/RightPanelStore.ts b/src/stores/right-panel/RightPanelStore.ts index 1d505b9b22b..bb4ddc4fcbf 100644 --- a/src/stores/right-panel/RightPanelStore.ts +++ b/src/stores/right-panel/RightPanelStore.ts @@ -34,6 +34,7 @@ import { import { ActionPayload } from "../../dispatcher/payloads"; import { Action } from "../../dispatcher/actions"; import { ActiveRoomChangedPayload } from "../../dispatcher/payloads/ActiveRoomChangedPayload"; +import { RoomViewStore } from "../RoomViewStore"; /** * A class for tracking the state of the right panel between layouts and @@ -55,6 +56,7 @@ export default class RightPanelStore extends ReadyWatchingStore { } protected async onReady(): Promise { + this.viewedRoomId = RoomViewStore.instance.getRoomId(); this.matrixClient.on(CryptoEvent.VerificationRequest, this.onVerificationRequestUpdate); this.loadCacheFromSettings(); this.emitAndUpdateSettings(); @@ -348,6 +350,7 @@ export default class RightPanelStore extends ReadyWatchingStore { }; private handleViewedRoomChange(oldRoomId: Optional, newRoomId: Optional) { + if (!this.mxClient) return; // not ready, onReady will handle the first room this.viewedRoomId = newRoomId; // load values from byRoomCache with the viewedRoomId. this.loadCacheFromSettings();