diff --git a/lib/router.dart b/lib/router.dart index e5ab7dde5..680c1a83c 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -67,6 +67,7 @@ import 'package:cake_wallet/src/screens/exchange_trade/exchange_confirm_page.dar import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_page.dart'; import 'package:flutter/services.dart'; import 'package:hive/hive.dart'; +import 'package:cake_wallet/wallet_type_utils.dart'; RouteSettings currentRouteSettings; @@ -80,9 +81,13 @@ Route createRoute(RouteSettings settings) { case Routes.newWalletFromWelcome: return CupertinoPageRoute( builder: (_) => getIt.get( - param1: (PinCodeState context, dynamic _) => - Navigator.of(context.context) - .pushNamed(Routes.newWalletType)), + param1: (PinCodeState context, dynamic _) { + if (isMoneroOnly) { + Navigator.of(context.context).pushNamed(Routes.newWallet, arguments: WalletType.monero); + } else { + Navigator.of(context.context).pushNamed(Routes.newWalletType); + } + }), fullscreenDialog: true); case Routes.newWalletType: diff --git a/lib/src/screens/new_wallet/new_wallet_page.dart b/lib/src/screens/new_wallet/new_wallet_page.dart index 71197423a..79998e944 100644 --- a/lib/src/screens/new_wallet/new_wallet_page.dart +++ b/lib/src/screens/new_wallet/new_wallet_page.dart @@ -60,7 +60,7 @@ class _WalletNameFormState extends State { _stateReaction ??= reaction((_) => _walletNewVM.state, (ExecutionState state) { if (state is ExecutedSuccessfullyState) { - Navigator.of(context).pushNamed(Routes.seed, arguments: true); + Navigator.of(context).pushNamed(Routes.preSeed, arguments: _walletNewVM.type); } if (state is FailureState) { diff --git a/lib/src/screens/wallet_list/wallet_list_page.dart b/lib/src/screens/wallet_list/wallet_list_page.dart index 19996a1e0..062ff2ad1 100644 --- a/lib/src/screens/wallet_list/wallet_list_page.dart +++ b/lib/src/screens/wallet_list/wallet_list_page.dart @@ -173,8 +173,13 @@ class WalletListBodyState extends State { EdgeInsets.only(bottom: 24, right: 24, left: 24), bottomSection: Column(children: [ PrimaryImageButton( - onPressed: () => - Navigator.of(context).pushNamed(Routes.newWalletType), + onPressed: () { + if (isMoneroOnly) { + Navigator.of(context).pushNamed(Routes.newWallet, arguments: WalletType.monero); + } else { + Navigator.of(context).pushNamed(Routes.newWalletType); + } + }, image: newWalletImage, text: S.of(context).wallet_list_create_new_wallet, color: Theme.of(context).accentTextTheme.body2.color, diff --git a/lib/view_model/wallet_creation_vm.dart b/lib/view_model/wallet_creation_vm.dart index 4a5ae8638..a3de16c1b 100644 --- a/lib/view_model/wallet_creation_vm.dart +++ b/lib/view_model/wallet_creation_vm.dart @@ -35,7 +35,9 @@ abstract class WalletCreationVMBase with Store { Future create({dynamic options}) async { try { state = IsExecutingState(); - name = await generateName(); + if (name?.isEmpty ?? true) { + name = await generateName(); + } final dirPath = await pathForWalletDir(name: name, type: type); final path = await pathForWallet(name: name, type: type); final credentials = getCredentials(options);