From 5f22e7ab1b2895679567e320d00347ae54386189 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Sun, 30 Jun 2024 12:27:35 +0200 Subject: [PATCH] UI fixes for wownero seed restore --- .../restore/wallet_restore_from_seed_form.dart | 8 ++++++-- lib/wownero/cw_wownero.dart | 16 ++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/src/screens/restore/wallet_restore_from_seed_form.dart b/lib/src/screens/restore/wallet_restore_from_seed_form.dart index 526c0c63f..01a5f2f97 100644 --- a/lib/src/screens/restore/wallet_restore_from_seed_form.dart +++ b/lib/src/screens/restore/wallet_restore_from_seed_form.dart @@ -185,7 +185,7 @@ class WalletRestoreFromSeedFormState extends State { ), ), ), - if (widget.displayLanguageSelector) + if (!seedTypeController.value.text.contains("14") && widget.displayLanguageSelector) GestureDetector( onTap: () async { await showPopUp( @@ -246,7 +246,11 @@ class WalletRestoreFromSeedFormState extends State { ); void _changeLanguage(String language) { - final setLang = isPolyseed ? "POLYSEED_$language" : language; + final setLang = isPolyseed + ? "POLYSEED_$language" + : seedTypeController.value.text.contains("14") + ? "WOWSEED_" + language + : language; setState(() { this.language = setLang; seedWidgetStateKey.currentState!.changeSeedLanguage(setLang); diff --git a/lib/wownero/cw_wownero.dart b/lib/wownero/cw_wownero.dart index 927330edb..eccb0f126 100644 --- a/lib/wownero/cw_wownero.dart +++ b/lib/wownero/cw_wownero.dart @@ -170,6 +170,10 @@ class CWWownero extends Wownero { final lang = language.replaceAll("POLYSEED_", ""); return PolyseedLang.getByEnglishName(lang).words; } + if (language.startsWith("WOWSEED_")) { + final lang = language.replaceAll("WOWSEED_", ""); + return PolyseedLang.getByEnglishName(lang).words; + } switch (language.toLowerCase()) { case 'english': return EnglishMnemonics.words; @@ -224,13 +228,13 @@ class CWWownero extends Wownero { name: name, password: password, height: height, mnemonic: mnemonic); @override - WalletCredentials createWowneroNewWalletCredentials({ - required String name, - required String language, - required bool isPolyseed, - String? password}) => + WalletCredentials createWowneroNewWalletCredentials( + {required String name, + required String language, + required bool isPolyseed, + String? password}) => WowneroNewWalletCredentials( - name: name, password: password, language: language, isPolyseed: isPolyseed); + name: name, password: password, language: language, isPolyseed: isPolyseed); @override Map getKeys(Object wallet) {