fix(useragent::dashboard): screen pushed twice due to improper listen hook

This commit is contained in:
hdbg
2026-03-28 19:17:55 +01:00
parent bce6ecd409
commit 643f251419

View File

@@ -15,11 +15,11 @@ class ServerConnectionScreen extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final connectionState = ref.watch(connectionManagerProvider);
if (connectionState.value != null) {
WidgetsBinding.instance.addPostFrameCallback((_) {
ref.listen(connectionManagerProvider, (_, next) {
if (next.value != null && context.mounted) {
context.router.replace(const VaultSetupRoute());
});
}
}
});
final body = switch (connectionState) {
AsyncLoading() => const CircularProgressIndicator(),