diff --git a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts index 2cc63bad..7f9eff2c 100644 --- a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts @@ -92,7 +92,8 @@ import { NotificationRequest, NativeService, UCAP_NATIVE_SERVICE, - NotificationType + NotificationType, + WindowState } from '@ucap-webmessenger/native'; import { StringUtil, DialogService } from '@ucap-webmessenger/ui'; import { @@ -208,9 +209,10 @@ export class AppNotificationService { (state: any) => state.messenger.sync.room.entities as Dictionary ) - ) + ), + this.nativeService.windowStateChanged() ), - tap(([notiOrRes, curRoomInfo, roomList]) => { + tap(([notiOrRes, curRoomInfo, roomList, windowStateChanged]) => { switch (notiOrRes.SSVC_TYPE) { case SSVC_TYPE_EVENT_SEND_RES: case SSVC_TYPE_EVENT_SEND_NOTI: @@ -243,7 +245,10 @@ export class AppNotificationService { if ( !!curRoomInfo && !!curRoomInfo.roomSeq && - curRoomInfo.roomSeq === noti.roomSeq + curRoomInfo.roomSeq === noti.roomSeq && + !!windowStateChanged && + windowStateChanged !== WindowState.Minimized && + windowStateChanged !== WindowState.Hidden ) { doNoti = false; }