Move room encryption check earlier in mount
parent
7507e3cb9a
commit
3ccfd9bee1
|
@ -117,15 +117,14 @@ class FilePanel extends React.Component<IProps, IState> {
|
||||||
|
|
||||||
public async componentDidMount(): Promise<void> {
|
public async componentDidMount(): Promise<void> {
|
||||||
const client = MatrixClientPeg.safeGet();
|
const client = MatrixClientPeg.safeGet();
|
||||||
|
|
||||||
await this.updateTimelineSet(this.props.roomId);
|
|
||||||
|
|
||||||
const isRoomEncrypted = Boolean(await client.getCrypto()?.isEncryptionEnabledInRoom(this.props.roomId));
|
const isRoomEncrypted = Boolean(await client.getCrypto()?.isEncryptionEnabledInRoom(this.props.roomId));
|
||||||
this.setState({
|
this.setState({
|
||||||
isRoomEncrypted,
|
isRoomEncrypted,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!isRoomEncrypted) return;
|
await this.updateTimelineSet(this.props.roomId);
|
||||||
|
|
||||||
|
if (isRoomEncrypted) return;
|
||||||
|
|
||||||
// The timelineSets filter makes sure that encrypted events that contain
|
// The timelineSets filter makes sure that encrypted events that contain
|
||||||
// URLs never get added to the timeline, even if they are live events.
|
// URLs never get added to the timeline, even if they are live events.
|
||||||
|
|
Loading…
Reference in New Issue