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

Commit

Permalink
dont show right panel when previewing a room without invite, as its e…
Browse files Browse the repository at this point in the history
…mpty
  • Loading branch information
bwindels committed Apr 17, 2019
1 parent 0a46347 commit dd911d1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/structures/RoomView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1647,6 +1647,7 @@ module.exports = React.createClass({
let aux = null;
let previewBar;
let hideCancel = false;
let hideRightPanel = false;
if (this.state.forwardingEvent !== null) {
aux = <ForwardMessage onCancelClick={this.onCancelClick} />;
} else if (this.state.searching) {
Expand Down Expand Up @@ -1690,6 +1691,8 @@ module.exports = React.createClass({
{ previewBar }
</div>
);
} else {
hideRightPanel = true;
}
} else if (hiddenHighlightCount > 0) {
aux = (
Expand Down Expand Up @@ -1861,14 +1864,16 @@ module.exports = React.createClass({
},
);

const rightPanel = this.state.room ? <RightPanel roomId={this.state.room.roomId} resizeNotifier={this.props.resizeNotifier} /> : undefined;
const rightPanel = !hideRightPanel && this.state.room &&
<RightPanel roomId={this.state.room.roomId} resizeNotifier={this.props.resizeNotifier} />;
const collapsedRhs = hideRightPanel || this.props.collapsedRhs;

return (
<main className={"mx_RoomView" + (inCall ? " mx_RoomView_inCall" : "")} ref="roomView">
<RoomHeader ref="header" room={this.state.room} searchInfo={searchInfo}
oobData={this.props.oobData}
inRoom={myMembership === 'join'}
collapsedRhs={this.props.collapsedRhs}
collapsedRhs={collapsedRhs}
onSearchClick={this.onSearchClick}
onSettingsClick={this.onSettingsClick}
onPinnedClick={this.onPinnedClick}
Expand All @@ -1879,7 +1884,7 @@ module.exports = React.createClass({
/>
<MainSplit
panel={rightPanel}
collapsedRhs={this.props.collapsedRhs}
collapsedRhs={collapsedRhs}
resizeNotifier={this.props.resizeNotifier}
>
<div className={fadableSectionClasses}>
Expand Down

0 comments on commit dd911d1

Please sign in to comment.