Add labs flag for default open right panel (#7618)

This commit is contained in:
J. Ryan Stinnett 2022-01-24 17:53:42 +00:00 committed by GitHub
parent 4540cf5b77
commit 20e6d36df7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 0 deletions

View file

@ -368,6 +368,21 @@ export default class RightPanelStore extends ReadyWatchingStore {
this.isViewingRoom = true; // Is viewing room will of course be removed when removing groups
// load values from byRoomCache with the viewedRoomId.
this.loadCacheFromSettings();
// If the right panel stays open mode is used, and the panel was either
// closed or never shown for that room, then force it open and display
// the room member list.
if (
SettingsStore.getValue("feature_right_panel_default_open") &&
!this.byRoom[this.viewedRoomId]?.isOpen
) {
this.byRoom[this.viewedRoomId] = {
isOpen: true,
history: [
{ phase: RightPanelPhases.RoomSummary },
{ phase: RightPanelPhases.RoomMemberList },
],
};
}
this.emitAndUpdateSettings();
};