mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
create a global notif timeline set for each client
This commit is contained in:
parent
7174648f94
commit
27b3f5f6b1
@ -18,6 +18,8 @@ limitations under the License.
|
|||||||
|
|
||||||
import Matrix from 'matrix-js-sdk';
|
import Matrix from 'matrix-js-sdk';
|
||||||
import utils from 'matrix-js-sdk/lib/utils';
|
import utils from 'matrix-js-sdk/lib/utils';
|
||||||
|
import EventTimeline from 'matrix-js-sdk/lib/models/event-timeline';
|
||||||
|
import EventTimelineSet from 'matrix-js-sdk/lib/models/event-timeline-set';
|
||||||
|
|
||||||
const localStorage = window.localStorage;
|
const localStorage = window.localStorage;
|
||||||
|
|
||||||
@ -104,6 +106,13 @@ class MatrixClientPeg {
|
|||||||
this.matrixClient.setMaxListeners(500);
|
this.matrixClient.setMaxListeners(500);
|
||||||
|
|
||||||
this.matrixClient.setGuest(Boolean(creds.guest));
|
this.matrixClient.setGuest(Boolean(creds.guest));
|
||||||
|
|
||||||
|
var notifTimelineSet = new EventTimelineSet(null, null, {
|
||||||
|
timelineSupport: true
|
||||||
|
});
|
||||||
|
// XXX: what is our initial pagination token?! it somehow needs to be synchronised with /sync.
|
||||||
|
notifTimelineSet.getLiveTimeline().setPaginationToken("", EventTimeline.BACKWARDS);
|
||||||
|
this.matrixClient.setNotifTimelineSet(notifTimelineSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user