diff --git a/src/components/structures/FilePanel.tsx b/src/components/structures/FilePanel.tsx index 5d754f0e4d..7ee0ab04eb 100644 --- a/src/components/structures/FilePanel.tsx +++ b/src/components/structures/FilePanel.tsx @@ -44,7 +44,10 @@ interface IProps { interface IState { timelineSet: EventTimelineSet | null; narrow: boolean; - isRoomEncrypted: boolean; + /** + * Whether the room is encrypted or not. If null, the state is still being determined. + */ + isRoomEncrypted: boolean | null; } /* @@ -63,7 +66,7 @@ class FilePanel extends React.Component { public state: IState = { timelineSet: null, narrow: false, - isRoomEncrypted: false, + isRoomEncrypted: null, }; private onRoomTimeline = ( @@ -270,7 +273,8 @@ class FilePanel extends React.Component { /> ); - const isRoomEncrypted = this.noRoom ? false : this.state.isRoomEncrypted; + const isRoomEncryptedLoaded = this.state.isRoomEncrypted !== null; + const isRoomEncrypted = Boolean(this.noRoom ? false : this.state.isRoomEncrypted); if (this.state.timelineSet) { return ( @@ -291,7 +295,9 @@ class FilePanel extends React.Component { {this.card.current && ( )} - + {isRoomEncryptedLoaded && ( + + )}