mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
fix: switch "seed" to "recovery phrase" in more places and handle edgecases for seed verification reminders
This commit is contained in:
@@ -43,19 +43,21 @@ class NewHomePage extends StatefulWidget {
|
||||
class _NewHomePageState extends State<NewHomePage> with RouteAware {
|
||||
MoneroAccountListViewModel? accountListViewModel;
|
||||
bool _lightningMode = false;
|
||||
late final ReactionDisposer _walletReaction;
|
||||
late final ReactionDisposer _migrationReaction;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_setAccountViewModel();
|
||||
reaction((_) => widget.dashboardViewModel.wallet, (_) {
|
||||
_walletReaction = reaction((_) => widget.dashboardViewModel.wallet, (_) {
|
||||
_setAccountViewModel();
|
||||
setState(() {
|
||||
_lightningMode = false;
|
||||
});
|
||||
});
|
||||
|
||||
reaction((_) => widget.dashboardViewModel.isMigratingToIronwood, (val) {
|
||||
_migrationReaction = reaction((_) => widget.dashboardViewModel.isMigratingToIronwood, (val) {
|
||||
if (val && !widget.dashboardViewModel.settingsStore.zcashMigrationModalViewed) {
|
||||
if (!context.mounted) {
|
||||
return;
|
||||
@@ -82,6 +84,8 @@ class _NewHomePageState extends State<NewHomePage> with RouteAware {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_walletReaction();
|
||||
_migrationReaction();
|
||||
routeObserver.unsubscribe(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,11 @@ import "package:flutter/widgets.dart";
|
||||
|
||||
void openWalletAfterSeedFlow(BuildContext context, WalletType walletType) {
|
||||
if (walletType == WalletType.bitcoin) {
|
||||
Navigator.of(context).pushNamed(Routes.lightningUsernamePage, arguments: true);
|
||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
Routes.lightningUsernamePage,
|
||||
(route) => route.isFirst,
|
||||
arguments: true,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -103,18 +103,10 @@ class _PreSeedPageState extends State<PreSeedPage> {
|
||||
void _confirmSkip() {
|
||||
Navigator.of(context).push(
|
||||
CupertinoPageRoute<void>(
|
||||
builder: (_) => SkipSeedVerificationPage(onConfirm: _skipVerification),
|
||||
builder: (_) => SkipSeedVerificationPage(
|
||||
onConfirm: () => openWalletAfterSeedFlow(context, widget.wallet.type),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _skipVerification() async {
|
||||
await widget.wallet.walletInfo.updateShowSeedBackupReminder(true);
|
||||
|
||||
if (!mounted) {
|
||||
return;
|
||||
}
|
||||
|
||||
openWalletAfterSeedFlow(context, widget.wallet.type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,8 +334,8 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
|
||||
});
|
||||
}
|
||||
|
||||
void _setLanguageLabel(String language) =>
|
||||
languageController.text = '${language.replaceAll("POLYSEED_", "")} (Seed language)';
|
||||
void _setLanguageLabel(String language) => languageController.text =
|
||||
"${language.replaceAll("POLYSEED_", "")} (${S.current.seed_language})";
|
||||
|
||||
void _changeSeedType(MoneroSeedType item) {
|
||||
widget.seedSettingsViewModel.setMoneroSeedType(item);
|
||||
|
||||
@@ -1148,7 +1148,7 @@ abstract class DashboardViewModelBase with Store {
|
||||
@action
|
||||
Future<void> dismissSeedBackupReminder() async {
|
||||
showSeedBackupReminder = false;
|
||||
await wallet.walletInfo.updateShowSeedBackupReminder(false);
|
||||
await wallet.walletInfo.clearSeedBackupReminder();
|
||||
}
|
||||
|
||||
@action
|
||||
|
||||
@@ -164,6 +164,7 @@ abstract class WalletNewVMBase extends WalletCreationVM with Store {
|
||||
@override
|
||||
Future<WalletBase> process(WalletCredentials credentials) async {
|
||||
walletCreationService.changeWalletType(type: type);
|
||||
credentials.walletInfo!.showSeedBackupReminder = newWalletArguments!.mnemonic == null;
|
||||
return walletCreationService.create(credentials, isTestnet: useTestnet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +153,6 @@ abstract class WalletSeedViewModelBase with Store {
|
||||
return;
|
||||
}
|
||||
|
||||
await _walletInfo.updateShowSeedBackupReminder(false);
|
||||
await _walletInfo.clearSeedBackupReminder();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user