From 1c99e3f3a74e41508458b2270056c2150f3907a1 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Tue, 11 Jul 2023 10:43:31 +0200 Subject: [PATCH] neon_notifications: Poll notifications --- packages/neon/neon_notifications/lib/blocs/notifications.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/neon/neon_notifications/lib/blocs/notifications.dart b/packages/neon/neon_notifications/lib/blocs/notifications.dart index cb683e67..d246eeb6 100644 --- a/packages/neon/neon_notifications/lib/blocs/notifications.dart +++ b/packages/neon/neon_notifications/lib/blocs/notifications.dart @@ -26,15 +26,18 @@ class NotificationsBloc extends InteractiveBloc }); unawaited(refresh()); + _timer = TimerBloc().registerTimer(const Duration(seconds: 30), refresh); } @override final NotificationsAppSpecificOptions options; final RequestManager _requestManager; final NextcloudClient _client; + late final NeonTimer _timer; @override void dispose() { + _timer.cancel(); unawaited(notifications.close()); unawaited(unreadCounter.close()); super.dispose();