From a9cee7cf7037150a8c572d507067152edc95ad11 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 1 Oct 2020 12:30:41 +0100 Subject: [PATCH] Fix right panel for peeking rooms Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/RoomView.tsx | 5 +---- src/components/views/rooms/MemberList.js | 4 ++-- src/stores/WidgetStore.ts | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index 4927c6b712..3aedaa5219 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -1820,7 +1820,6 @@ export default class RoomView extends React.Component { let aux = null; let previewBar; let hideCancel = false; - let forceHideRightPanel = false; if (this.state.forwardingEvent) { aux = ; } else if (this.state.searching) { @@ -1865,8 +1864,6 @@ export default class RoomView extends React.Component { { previewBar } ); - } else { - forceHideRightPanel = true; } } else if (hiddenHighlightCount > 0) { aux = ( @@ -2069,7 +2066,7 @@ export default class RoomView extends React.Component { "mx_fadable_faded": this.props.disabled, }); - const showRightPanel = !forceHideRightPanel && this.state.room && this.state.showRightPanel; + const showRightPanel = this.state.room && this.state.showRightPanel; const rightPanel = showRightPanel ? : null; diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index ae122a3783..9da6e22847 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -121,8 +121,8 @@ export default class MemberList extends React.Component { this.setState(this._getMembersState(this.roomMembers())); this._listenForMembersChanges(); } - } else if (membership === "invite") { - // show the members we've got when invited + } else { + // show the members we already have loaded this.setState(this._getMembersState(this.roomMembers())); } } diff --git a/src/stores/WidgetStore.ts b/src/stores/WidgetStore.ts index 10327ce4e9..bfddb5adfa 100644 --- a/src/stores/WidgetStore.ts +++ b/src/stores/WidgetStore.ts @@ -118,6 +118,7 @@ export default class WidgetStore extends AsyncStoreWithClient { } private loadRoomWidgets(room: Room) { + if (!room) return; const roomInfo = this.roomMap.get(room.roomId); roomInfo.widgets = []; this.generateApps(room).forEach(app => {