From db743aea58c9be859191bc2879aa57f786b12af1 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Wed, 27 Nov 2024 11:34:41 +0100 Subject: [PATCH] Check room encryption earlier --- src/components/structures/RoomView.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index 58e37606b2b..512745e6a0f 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -713,6 +713,11 @@ export class RoomView extends React.Component { if (initial) { this.setupRoom(newState.room, newState.roomId, !!newState.joining, !!newState.shouldPeek); } + + // We don't block the initial setup but we want to make it early to not block the timeline rendering + this.setState({ + isRoomEncrypted: roomId ? await this.getIsRoomEncrypted(roomId) : null, + }); }; private onConnectedCalls = (): void => { @@ -863,7 +868,7 @@ export class RoomView extends React.Component { return isManuallyShown && widgets.length > 0; } - public async componentDidMount(): Promise { + public componentDidMount(): void { this.unmounted = false; this.dispatcherRef = defaultDispatcher.register(this.onAction);