diff --git a/lib/controllers/unified_push.dart b/lib/controllers/unified_push.dart index 47354ad..f637156 100644 --- a/lib/controllers/unified_push.dart +++ b/lib/controllers/unified_push.dart @@ -103,7 +103,7 @@ class UnifiedPushController extends AsyncNotifier { await ref .watch(PushKeyController.provider(instance).notifier) .set(null); - state = .data(false); + ref.invalidateSelf(); }, ); @@ -139,7 +139,7 @@ class UnifiedPushController extends AsyncNotifier { vapid: capabilities.webpush?.vapid, ); - state = .data(true); + if (!alreadyRegistered) ref.invalidateSelf(); } Future deregister() async { @@ -157,7 +157,7 @@ class UnifiedPushController extends AsyncNotifier { } await UnifiedPush.unregister(clientState.deviceId!); - state = .data(false); + ref.invalidateSelf(); } static final provider = AsyncNotifierProvider(