mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
prevent room summary from being updated every time it is in /sync resp
This commit is contained in:
parent
46abafdccc
commit
86df4993e1
@ -58,9 +58,16 @@ function applySyncResponse(data, roomResponse, membership) {
|
|||||||
}
|
}
|
||||||
const unreadNotifications = roomResponse.unread_notifications;
|
const unreadNotifications = roomResponse.unread_notifications;
|
||||||
if (unreadNotifications) {
|
if (unreadNotifications) {
|
||||||
data = data.cloneIfNeeded();
|
const highlightCount = unreadNotifications.highlight_count || 0;
|
||||||
data.highlightCount = unreadNotifications.highlight_count || 0;
|
if (highlightCount !== data.highlightCount) {
|
||||||
data.notificationCount = unreadNotifications.notification_count;
|
data = data.cloneIfNeeded();
|
||||||
|
data.highlightCount = highlightCount;
|
||||||
|
}
|
||||||
|
const notificationCount = unreadNotifications.notification_count;
|
||||||
|
if (notificationCount !== data.notificationCount) {
|
||||||
|
data = data.cloneIfNeeded();
|
||||||
|
data.notificationCount = notificationCount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
Loading…
Reference in New Issue
Block a user