Skip to content

Commit

Permalink
fix: Do not hide push if app romm in foreground but is in background
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Nov 27, 2023
1 parent ee599c1 commit 085bb19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/utils/push_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io';
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
Expand Down Expand Up @@ -83,7 +84,8 @@ Future<void> _tryPushHelper(
if (!isBackgroundMessage &&
activeRoomId == notification.roomId &&
activeRoomId != null &&
client.syncPresence == null) {
client.syncPresence == null &&
WidgetsBinding.instance.lifecycleState == AppLifecycleState.resumed) {
Logs().v('Room is in foreground. Stop push helper here.');
return;
}
Expand Down

0 comments on commit 085bb19

Please sign in to comment.