You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-13 08:02:38 +03:00
Merge branch 'travis/room-list/watchers' into travis/room-list/unread-2
This commit is contained in:
@@ -51,8 +51,17 @@ export class WatchManager {
|
|||||||
const roomWatchers = this._watchers[settingName];
|
const roomWatchers = this._watchers[settingName];
|
||||||
const callbacks = [];
|
const callbacks = [];
|
||||||
|
|
||||||
if (inRoomId !== null && roomWatchers[inRoomId]) callbacks.push(...roomWatchers[inRoomId]);
|
if (inRoomId !== null && roomWatchers[inRoomId]) {
|
||||||
if (roomWatchers[null]) callbacks.push(...roomWatchers[null]);
|
callbacks.push(...roomWatchers[inRoomId]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!inRoomId) {
|
||||||
|
// Fire updates to all the individual room watchers too, as they probably
|
||||||
|
// care about the change higher up.
|
||||||
|
callbacks.push(...Object.values(roomWatchers).reduce((r, a) => [...r, ...a], []));
|
||||||
|
} else if (roomWatchers[null]) {
|
||||||
|
callbacks.push(...roomWatchers[null]);
|
||||||
|
}
|
||||||
|
|
||||||
for (const callback of callbacks) {
|
for (const callback of callbacks) {
|
||||||
callback(inRoomId, atLevel, newValueAtLevel);
|
callback(inRoomId, atLevel, newValueAtLevel);
|
||||||
|
|||||||
Reference in New Issue
Block a user