improved performance and battery usage on older devices
This commit is contained in:
@@ -7,6 +7,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import '../push/push_message_handler.dart';
|
||||
import '../routing/app_routes.dart';
|
||||
import '../state/app/modules/chat/bloc/chat_bloc.dart';
|
||||
import '../state/app/modules/chat_list/bloc/chat_list_bloc.dart';
|
||||
import '../utils/debouncer.dart';
|
||||
import '../widget/debug/debug_tile.dart';
|
||||
import '../widget/debug/json_viewer.dart';
|
||||
import '../widget/info_dialog.dart';
|
||||
@@ -35,7 +37,14 @@ class NotificationController {
|
||||
);
|
||||
await NotificationTasks.refreshBadge();
|
||||
if (!context.mounted) return;
|
||||
NotificationTasks.updateProviders(context);
|
||||
// A busy group chat delivers pushes in bursts; one silent refresh after
|
||||
// the burst replaces a full room-list fetch per message.
|
||||
final chatList = context.read<ChatListBloc>();
|
||||
Debouncer.debounce(
|
||||
'pushChatListRefresh',
|
||||
const Duration(seconds: 1),
|
||||
() => chatList.refresh(silent: true),
|
||||
);
|
||||
}
|
||||
|
||||
static Future<void> onAppOpenedByNotification(
|
||||
|
||||
Reference in New Issue
Block a user