From 3ccfd9bee1a27f70815c80fb16b1f8a99500e04f Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Wed, 23 Oct 2024 16:15:10 +0200 Subject: [PATCH] Move room encryption check earlier in mount --- src/components/structures/FilePanel.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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.