You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
MatrixChat: Fix the limited timeline checkpoint adding.
This commit is contained in:
@@ -347,15 +347,10 @@ export default class EventIndexer {
|
|||||||
console.log("Seshat: Stopping crawler function");
|
console.log("Seshat: Stopping crawler function");
|
||||||
}
|
}
|
||||||
|
|
||||||
async addCheckpointForLimitedRoom(roomId) {
|
async addCheckpointForLimitedRoom(room) {
|
||||||
const platform = PlatformPeg.get();
|
const platform = PlatformPeg.get();
|
||||||
if (!platform.supportsEventIndexing()) return;
|
if (!platform.supportsEventIndexing()) return;
|
||||||
if (!MatrixClientPeg.get().isRoomEncrypted(roomId)) return;
|
if (!MatrixClientPeg.get().isRoomEncrypted(room.roomId)) return;
|
||||||
|
|
||||||
const client = MatrixClientPeg.get();
|
|
||||||
const room = client.getRoom(roomId);
|
|
||||||
|
|
||||||
if (room === null) return;
|
|
||||||
|
|
||||||
const timeline = room.getLiveTimeline();
|
const timeline = room.getLiveTimeline();
|
||||||
const token = timeline.getPaginationToken("b");
|
const token = timeline.getPaginationToken("b");
|
||||||
|
|||||||
@@ -1223,8 +1223,6 @@ export default createReactClass({
|
|||||||
* Called when the session is logged out
|
* Called when the session is logged out
|
||||||
*/
|
*/
|
||||||
_onLoggedOut: async function() {
|
_onLoggedOut: async function() {
|
||||||
const platform = PlatformPeg.get();
|
|
||||||
|
|
||||||
this.notifyNewScreen('login');
|
this.notifyNewScreen('login');
|
||||||
this.setStateForNewView({
|
this.setStateForNewView({
|
||||||
view: VIEWS.LOGIN,
|
view: VIEWS.LOGIN,
|
||||||
@@ -1313,7 +1311,7 @@ export default createReactClass({
|
|||||||
const eventIndex = EventIndexPeg.get();
|
const eventIndex = EventIndexPeg.get();
|
||||||
if (eventIndex === null) return;
|
if (eventIndex === null) return;
|
||||||
if (resetAllTimelines === true) return;
|
if (resetAllTimelines === true) return;
|
||||||
await eventIndex.addCheckpointForLimitedRoom(roomId);
|
await eventIndex.addCheckpointForLimitedRoom(room);
|
||||||
});
|
});
|
||||||
|
|
||||||
cli.on('sync', function(state, prevState, data) {
|
cli.on('sync', function(state, prevState, data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user