diff --git a/lib/controllers/unified_push.dart b/lib/controllers/unified_push.dart index 60d3271..0c2ac8e 100644 --- a/lib/controllers/unified_push.dart +++ b/lib/controllers/unified_push.dart @@ -68,7 +68,7 @@ class UnifiedPushController extends AsyncNotifier { event.unreadType?.shouldNotify() != true || (!isInBackground && await windowManager.isFocused().onError((_, _) => false) && - await ref.watch( + await ref.read( KeyController.provider(KeyController.roomKey).future, ) == event.roomId)) { @@ -122,10 +122,10 @@ class UnifiedPushController extends AsyncNotifier { Future register([bool alreadyRegistered = false]) async { final clientStateProvider = ClientStateController.provider; - while (ref.watch(clientStateProvider)?.deviceId == null) { + while (ref.read(clientStateProvider)?.deviceId == null) { await Future.delayed(.new(milliseconds: 250)); } - final clientState = ref.watch(clientStateProvider); + final clientState = ref.read(clientStateProvider); final capabilities = await ref .watch(ClientController.provider.notifier) @@ -151,8 +151,8 @@ class UnifiedPushController extends AsyncNotifier { } Future deregister() async { - final clientState = ref.watch(ClientStateController.provider); - final key = await ref.watch( + final clientState = ref.read(ClientStateController.provider); + final key = await ref.read( PushKeyController.provider(clientState!.deviceId!).future, );