fix not in range error when logging out

This commit is contained in:
Henry Hiles 2026-10-03 11:44:35 -04:00
commit e54b059bc9
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -269,12 +269,16 @@ class SettingsSectionsController
final colorScheme = Theme.of(context).colorScheme;
return M3EButton.icon(
onPressed: () async {
await ref
.watch(UnifiedPushController.provider.notifier)
final container = ProviderScope.containerOf(context);
Navigator.of(context)
.popUntil((route) => route.isFirst);
await container
.read(UnifiedPushController.provider.notifier)
.deregister()
.onError(showError);
await ref
.watch(ClientController.provider.notifier)
await container
.read(ClientController.provider.notifier)
.logout()
.onError(showError);
},