fix(@desktop/notifications): send OS notifications if app is not focused (#9652)

This commit is contained in:
Mykhailo Prakhov 2023-02-27 17:08:16 +01:00 committed by GitHub
parent 5bf702fd09
commit 7cef444601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -181,6 +181,8 @@ QtObject:
# An exemption from the diagrams, at least for now, is that we don't need to implement the "Badge Check" block here,
# cause that's already handled in appropriate modules.
let appIsActive = app_isActive(singletonInstance.engine)
if(details.notificationType == NotificationType.NewMessage or
details.notificationType == NotificationType.NewMessageWithPersonalMention or
details.notificationType == NotificationType.NewMessageWithGlobalMention or
@ -194,10 +196,9 @@ QtObject:
details.notificationType == NotificationType.NewMessageWithPersonalMention or
details.notificationType == NotificationType.NewMessageWithGlobalMention) and
details.sectionActive and
details.chatActive):
details.chatActive and appIsActive):
return
let appIsActive = app_isActive(singletonInstance.engine)
if(appIsActive):
debug "Add APP notification", title=title, message=message
self.events.emit(SIGNAL_DISPLAY_APP_NOTIFICATION, data)