Fix notifications not being sent on decryption correction

This commit is contained in:
TrojanerHD 2024-10-05 00:32:37 +02:00 committed by Trojaner
parent c110e64341
commit 80b8526698

View file

@ -204,7 +204,14 @@ function MessageNotifications() {
const cachedUnreadInfo = unreadCacheRef.current.get(room.roomId);
unreadCacheRef.current.set(room.roomId, unreadInfo);
if (unreadInfo.total === 0) return;
if (unreadInfo.total === 0) {
const handleUnreadEvent: RoomEventHandlerMap[RoomEvent.UnreadNotifications] = () => {
handleTimelineEvent(mEvent, room, toStartOfTimeline, removed, data);
room.removeListener(RoomEvent.UnreadNotifications, handleUnreadEvent);
};
room.on(RoomEvent.UnreadNotifications, handleUnreadEvent);
return;
}
if (
cachedUnreadInfo &&
unreadEqual(unreadInfoToUnread(cachedUnreadInfo), unreadInfoToUnread(unreadInfo))