only read stuff in UP controller

This commit is contained in:
Henry Hiles 2026-09-22 12:41:39 -04:00
commit ea73ae03a9
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

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