mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 09:35:12 +00:00
fix: Do not hide push if app romm in foreground but is in background
This commit is contained in:
parent
ee599c1f52
commit
085bb19da5
1 changed files with 3 additions and 1 deletions
|
@ -2,6 +2,7 @@ import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||||
|
@ -83,7 +84,8 @@ Future<void> _tryPushHelper(
|
||||||
if (!isBackgroundMessage &&
|
if (!isBackgroundMessage &&
|
||||||
activeRoomId == notification.roomId &&
|
activeRoomId == notification.roomId &&
|
||||||
activeRoomId != null &&
|
activeRoomId != null &&
|
||||||
client.syncPresence == null) {
|
client.syncPresence == null &&
|
||||||
|
WidgetsBinding.instance.lifecycleState == AppLifecycleState.resumed) {
|
||||||
Logs().v('Room is in foreground. Stop push helper here.');
|
Logs().v('Room is in foreground. Stop push helper here.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue