mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 04:34:59 +08:00
Move room encryption check earlier in mount
This commit is contained in:
parent
7507e3cb9a
commit
3ccfd9bee1
@ -117,15 +117,14 @@ class FilePanel extends React.Component<IProps, IState> {
|
||||
|
||||
public async componentDidMount(): Promise<void> {
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user