refactor: Check if app is in foreground on pushhelper

This commit is contained in:
krille-chan 2023-11-27 17:26:05 +01:00
commit c6007a3c3d
No known key found for this signature in database
9 changed files with 4 additions and 25 deletions

View file

@ -81,10 +81,8 @@ Future<void> _tryPushHelper(
notification.toJson(),
);
if (!isBackgroundMessage &&
if (notification.roomId != null &&
activeRoomId == notification.roomId &&
activeRoomId != null &&
client.syncPresence == null &&
WidgetsBinding.instance.lifecycleState == AppLifecycleState.resumed) {
Logs().v('Room is in foreground. Stop push helper here.');
return;