From e54b059bc92bdb8e472428b09d2c3a91b57eeb74 Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Sat, 3 Oct 2026 11:44:35 -0400 Subject: [PATCH] fix not in range error when logging out --- lib/controllers/settings_sections.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/controllers/settings_sections.dart b/lib/controllers/settings_sections.dart index 913f672..1dd6db9 100644 --- a/lib/controllers/settings_sections.dart +++ b/lib/controllers/settings_sections.dart @@ -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); },