You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Fix RoomView re-mounting breaking peeking
Because as of React 16 order of unmount & re-mount is undefined this was causing the possibility of the unmount running after the willMount of the replacement RoomView, upsetting the state of the singleton inside the js-sdk.
This commit is contained in:
@ -267,12 +267,6 @@ export default class RoomView extends React.Component<IProps, IState> {
|
|||||||
this.layoutWatcherRef = SettingsStore.watchSetting("useIRCLayout", null, this.onLayoutChange);
|
this.layoutWatcherRef = SettingsStore.watchSetting("useIRCLayout", null, this.onLayoutChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: [REACT-WARNING] Move into constructor
|
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
UNSAFE_componentWillMount() {
|
|
||||||
this.onRoomViewStoreUpdate(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private onWidgetStoreUpdate = () => {
|
private onWidgetStoreUpdate = () => {
|
||||||
if (this.state.room) {
|
if (this.state.room) {
|
||||||
this.checkWidgets(this.state.room);
|
this.checkWidgets(this.state.room);
|
||||||
@ -512,6 +506,8 @@ export default class RoomView extends React.Component<IProps, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
this.onRoomViewStoreUpdate(true);
|
||||||
|
|
||||||
const call = this.getCallForRoom();
|
const call = this.getCallForRoom();
|
||||||
const callState = call ? call.state : null;
|
const callState = call ? call.state : null;
|
||||||
this.setState({
|
this.setState({
|
||||||
|
Reference in New Issue
Block a user