mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-23 19:05:51 +00:00
refresh eth wallets list on adding new (restored) token wallet
This commit is contained in:
parent
9ad0343d63
commit
5ce5ae3f4d
2 changed files with 57 additions and 23 deletions
|
@ -16,6 +16,8 @@ import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/confirm_r
|
||||||
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_failed_dialog.dart';
|
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_failed_dialog.dart';
|
||||||
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_succeeded_dialog.dart';
|
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_succeeded_dialog.dart';
|
||||||
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart';
|
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart';
|
||||||
|
import 'package:stackwallet/pages/add_wallet_views/select_wallet_for_token_view.dart';
|
||||||
|
import 'package:stackwallet/pages/add_wallet_views/verify_recovery_phrase_view/verify_recovery_phrase_view.dart';
|
||||||
import 'package:stackwallet/pages/home_view/home_view.dart';
|
import 'package:stackwallet/pages/home_view/home_view.dart';
|
||||||
import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart';
|
import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart';
|
||||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart';
|
import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart';
|
||||||
|
@ -310,24 +312,54 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
||||||
.read(walletsChangeNotifierProvider.notifier)
|
.read(walletsChangeNotifierProvider.notifier)
|
||||||
.addWallet(walletId: manager.walletId, manager: manager);
|
.addWallet(walletId: manager.walletId, manager: manager);
|
||||||
|
|
||||||
if (mounted) {
|
final isCreateSpecialEthWallet =
|
||||||
if (isDesktop) {
|
ref.read(createSpecialEthWalletRoutingFlag);
|
||||||
Navigator.of(context)
|
if (isCreateSpecialEthWallet) {
|
||||||
.popUntil(ModalRoute.withName(DesktopHomeView.routeName));
|
ref.read(createSpecialEthWalletRoutingFlag.notifier).state =
|
||||||
} else {
|
false;
|
||||||
unawaited(Navigator.of(context).pushNamedAndRemoveUntil(
|
ref
|
||||||
HomeView.routeName, (route) => false));
|
.read(newEthWalletTriggerTempUntilHiveCompletelyDeleted.state)
|
||||||
}
|
.state =
|
||||||
|
!ref
|
||||||
|
.read(newEthWalletTriggerTempUntilHiveCompletelyDeleted
|
||||||
|
.state)
|
||||||
|
.state;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mounted) {
|
||||||
|
if (isDesktop) {
|
||||||
|
Navigator.of(context).popUntil(
|
||||||
|
ModalRoute.withName(
|
||||||
|
DesktopHomeView.routeName,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
if (isCreateSpecialEthWallet) {
|
||||||
|
Navigator.of(context).popUntil(
|
||||||
|
ModalRoute.withName(
|
||||||
|
SelectWalletForTokenView.routeName,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
unawaited(
|
||||||
|
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||||
|
HomeView.routeName,
|
||||||
|
(route) => false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await showDialog<dynamic>(
|
||||||
|
context: context,
|
||||||
|
useSafeArea: false,
|
||||||
|
barrierDismissible: true,
|
||||||
|
builder: (context) {
|
||||||
|
return const RestoreSucceededDialog();
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await showDialog<dynamic>(
|
|
||||||
context: context,
|
|
||||||
useSafeArea: false,
|
|
||||||
barrierDismissible: true,
|
|
||||||
builder: (context) {
|
|
||||||
return const RestoreSucceededDialog();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (!Platform.isLinux && !isDesktop) {
|
if (!Platform.isLinux && !isDesktop) {
|
||||||
await Wakelock.disable();
|
await Wakelock.disable();
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,14 +141,16 @@ class _VerifyRecoveryPhraseViewState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
unawaited(showFloatingFlushBar(
|
unawaited(
|
||||||
type: FlushBarType.success,
|
showFloatingFlushBar(
|
||||||
message: "Correct! Your wallet is set up.",
|
type: FlushBarType.success,
|
||||||
iconAsset: Assets.svg.check,
|
message: "Correct! Your wallet is set up.",
|
||||||
context: context,
|
iconAsset: Assets.svg.check,
|
||||||
));
|
context: context,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
unawaited(showFloatingFlushBar(
|
unawaited(showFloatingFlushBar(
|
||||||
type: FlushBarType.warning,
|
type: FlushBarType.warning,
|
||||||
|
|
Loading…
Reference in a new issue