diff --git a/lib/controllers/push_key.dart b/lib/controllers/push_key.dart index b73aa89..7217886 100644 --- a/lib/controllers/push_key.dart +++ b/lib/controllers/push_key.dart @@ -18,7 +18,7 @@ class PushKeyController(final String instance) extends Notifier { state = value; notifier.set( json.encode( - prefs.add(instance, value).where((_, value) => value != null), + prefs.add(instance, value).where((_, value) => value != null).unlock, ), ); } diff --git a/lib/controllers/unified_push.dart b/lib/controllers/unified_push.dart index cb42577..1c1b41a 100644 --- a/lib/controllers/unified_push.dart +++ b/lib/controllers/unified_push.dart @@ -30,7 +30,9 @@ class UnifiedPushController extends AsyncNotifier { ), onNewEndpoint: (endpoint, instance) async { final pushKey = endpoint.pubKeySet!.pubKey; - ref.watch(PushKeyController.provider(instance).notifier).set(pushKey); + await ref + .watch(PushKeyController.provider(instance).notifier) + .set(pushKey); await client.registerPusher( .new(