fix(useragent::dashboard): screen pushed twice due to improper listen hook
This commit is contained in:
@@ -15,11 +15,11 @@ class ServerConnectionScreen extends HookConsumerWidget {
|
|||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final connectionState = ref.watch(connectionManagerProvider);
|
final connectionState = ref.watch(connectionManagerProvider);
|
||||||
|
|
||||||
if (connectionState.value != null) {
|
ref.listen(connectionManagerProvider, (_, next) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
if (next.value != null && context.mounted) {
|
||||||
context.router.replace(const VaultSetupRoute());
|
context.router.replace(const VaultSetupRoute());
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
final body = switch (connectionState) {
|
final body = switch (connectionState) {
|
||||||
AsyncLoading() => const CircularProgressIndicator(),
|
AsyncLoading() => const CircularProgressIndicator(),
|
||||||
|
|||||||
Reference in New Issue
Block a user