mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-09-01 07:04:07 +00:00
fix some smaller issues
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
cf6e46f976
commit
6487efce35
2 changed files with 6 additions and 2 deletions
|
|
@ -1,8 +1,10 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:cryptography_flutter_plus/cryptography_flutter_plus.dart';
|
||||
import 'package:cryptography_plus/cryptography_plus.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:twonly/globals.dart';
|
||||
import 'package:twonly/locator.dart';
|
||||
|
|
@ -125,7 +127,9 @@ Future<void> showLocalPushNotification(
|
|||
if (targetGroupId != null) {
|
||||
try {
|
||||
final currentUri = routerProvider.routerDelegate.currentConfiguration.uri;
|
||||
if (currentUri.path.contains(targetGroupId)) {
|
||||
final isResumed =
|
||||
WidgetsBinding.instance.lifecycleState == AppLifecycleState.resumed;
|
||||
if (isResumed && currentUri.path.contains(targetGroupId)) {
|
||||
Log.info(
|
||||
'Suppressing local push notification because chat with group $targetGroupId is currently open.',
|
||||
);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Future<void> firebaseMessagingBackgroundHandler(RemoteMessage message) async {
|
|||
|
||||
if (Platform.isAndroid) {
|
||||
if (isInitialized) {
|
||||
await handlePeriodicTask(lastExecutionInSecondsLimit: 10);
|
||||
await handlePeriodicTask(lastExecutionInSecondsLimit: 3);
|
||||
}
|
||||
} else {
|
||||
// make sure every thing run...
|
||||
|
|
|
|||
Loading…
Reference in a new issue