Don't inhibit current room notifications if user has Modal open (#7274)

This commit is contained in:
Michael Telatynski
2021-12-03 11:02:47 +00:00
committed by GitHub
parent 494af883f3
commit 37bf85489d
2 changed files with 11 additions and 6 deletions

View File

@@ -379,11 +379,14 @@ export const Notifier = {
}
},
_evaluateEvent: function(ev) {
_evaluateEvent: function(ev: MatrixEvent) {
const room = MatrixClientPeg.get().getRoom(ev.getRoomId());
const actions = MatrixClientPeg.get().getPushActionsForEvent(ev);
if (actions && actions.notify) {
if (RoomViewStore.getRoomId() === room.roomId && UserActivity.sharedInstance().userActiveRecently()) {
if (RoomViewStore.getRoomId() === room.roomId &&
UserActivity.sharedInstance().userActiveRecently() &&
!Modal.hasDialogs()
) {
// don't bother notifying as user was recently active in this room
return;
}