Fix some stuff

This commit is contained in:
Michael Telatynski 2020-08-29 12:51:37 +01:00
parent 34b960d8cb
commit 78812b6f85
9 changed files with 51 additions and 42 deletions

View file

@ -99,8 +99,8 @@ export default class RoomView extends React.Component {
static contextType = MatrixClientContext;
constructor(props) {
super(props);
constructor(props, context) {
super(props, context);
const llMembers = this.context.hasLazyLoadMembersEnabled();
this.state = {
@ -186,7 +186,6 @@ export default class RoomView extends React.Component {
// Start listening for RoomViewStore updates
this._roomStoreToken = RoomViewStore.addListener(this._onRoomViewStoreUpdate);
this._rightPanelStoreToken = RightPanelStore.getSharedInstance().addListener(this._onRightPanelStoreUpdate);
this._onRoomViewStoreUpdate(true);
WidgetEchoStore.on('update', this._onWidgetEchoStoreUpdate);
this._showReadReceiptsWatchRef = SettingsStore.watchSetting("showReadReceipts", null,
@ -198,6 +197,11 @@ export default class RoomView extends React.Component {
this._layoutWatcherRef = SettingsStore.watchSetting("useIRCLayout", null, this.onLayoutChange);
}
// TODO: [REACT-WARNING] Move into constructor
UNSAFE_componentWillMount() {
this._onRoomViewStoreUpdate(true);
}
_onReadReceiptsChange = () => {
this.setState({
showReadReceipts: SettingsStore.getValue("showReadReceipts", this.state.roomId),