Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix RightPanelStore handling first room on app launch wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Apr 20, 2022
1 parent 65c74bd commit 2a2d3e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/stores/right-panel/RightPanelStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -55,6 +56,7 @@ export default class RightPanelStore extends ReadyWatchingStore {
}

protected async onReady(): Promise<any> {
this.viewedRoomId = RoomViewStore.instance.getRoomId();
this.matrixClient.on(CryptoEvent.VerificationRequest, this.onVerificationRequestUpdate);
this.loadCacheFromSettings();
this.emitAndUpdateSettings();
Expand Down Expand Up @@ -348,6 +350,7 @@ export default class RightPanelStore extends ReadyWatchingStore {
};

private handleViewedRoomChange(oldRoomId: Optional<string>, newRoomId: Optional<string>) {
if (!this.mxClient) return; // not ready, onReady will handle the first room
this.viewedRoomId = newRoomId;
// load values from byRoomCache with the viewedRoomId.
this.loadCacheFromSettings();
Expand Down

0 comments on commit 2a2d3e7

Please sign in to comment.