diff --git a/src/components/structures/FilePanel.tsx b/src/components/structures/FilePanel.tsx index 8da686ab5d..b7c084c524 100644 --- a/src/components/structures/FilePanel.tsx +++ b/src/components/structures/FilePanel.tsx @@ -117,15 +117,14 @@ class FilePanel extends React.Component { public async componentDidMount(): Promise { const client = MatrixClientPeg.safeGet(); - - await this.updateTimelineSet(this.props.roomId); - const isRoomEncrypted = Boolean(await client.getCrypto()?.isEncryptionEnabledInRoom(this.props.roomId)); this.setState({ isRoomEncrypted, }); - if (!isRoomEncrypted) return; + await this.updateTimelineSet(this.props.roomId); + + if (isRoomEncrypted) return; // The timelineSets filter makes sure that encrypted events that contain // URLs never get added to the timeline, even if they are live events.