You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Merge pull request #3979 from matrix-org/dbkr/no_peeking
Don't peek until the matrix client is ready
This commit is contained in:
@@ -46,6 +46,7 @@ const INITIAL_STATE = {
|
|||||||
forwardingEvent: null,
|
forwardingEvent: null,
|
||||||
|
|
||||||
quotingEvent: null,
|
quotingEvent: null,
|
||||||
|
matrixClientIsReady: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,6 +60,9 @@ class RoomViewStore extends Store {
|
|||||||
|
|
||||||
// Initialise state
|
// Initialise state
|
||||||
this._state = INITIAL_STATE;
|
this._state = INITIAL_STATE;
|
||||||
|
if (MatrixClientPeg.get()) {
|
||||||
|
this._state.matrixClientIsReady = MatrixClientPeg.get().isInitialSyncComplete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_setState(newState) {
|
_setState(newState) {
|
||||||
@@ -136,6 +140,11 @@ class RoomViewStore extends Store {
|
|||||||
}, /*className=*/null, /*isPriority=*/false, /*isStatic=*/true);
|
}, /*className=*/null, /*isPriority=*/false, /*isStatic=*/true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'sync_state':
|
||||||
|
this._setState({
|
||||||
|
matrixClientIsReady: MatrixClientPeg.get().isInitialSyncComplete(),
|
||||||
|
});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,7 +359,7 @@ class RoomViewStore extends Store {
|
|||||||
}
|
}
|
||||||
|
|
||||||
shouldPeek() {
|
shouldPeek() {
|
||||||
return this._state.shouldPeek;
|
return this._state.shouldPeek && this._state.matrixClientIsReady;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user