Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ class _WalletSettingsViewState extends ConsumerState<WalletSettingsView> {
(wallet as ViewOnlyOptionInterface).isViewOnly) {
// TODO: is something needed here?
} else {
mnemonic = await wallet.getMnemonicAsWords();
try {
mnemonic = await wallet.getMnemonicAsWords();
} catch (_) {
// Key-restored wallets may not have a mnemonic.
}
}
}
}
Expand Down Expand Up @@ -417,10 +421,9 @@ class _WalletSettingsViewState extends ConsumerState<WalletSettingsView> {
iconSize: 16,
title: "Epicbox Servers",
onPressed: () {
Navigator.of(context).pushNamed(
ManageEpicboxView.routeName,
arguments: walletId,
);
Navigator.of(
context,
).pushNamed(ManageEpicboxView.routeName, arguments: walletId);
},
),
if (canBackup) const SizedBox(height: 8),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,19 @@ class DeleteWalletWarningView extends ConsumerWidget {
),
const SizedBox(height: 16),
RoundedContainer(
color:
Theme.of(
context,
).extension<StackColors>()!.warningBackground,
color: Theme.of(
context,
).extension<StackColors>()!.warningBackground,
child: Text(
"You are going to permanently delete your wallet.\n\n"
"If you delete your wallet, the only way you can have access"
" to your funds is by using your backup key.\n\n"
"${AppConfig.appName} does not keep nor is able to restore "
"your backup key or your wallet.\n\nPLEASE SAVE YOUR BACKUP KEY.",
style: STextStyles.baseXS(context).copyWith(
color:
Theme.of(
context,
).extension<StackColors>()!.warningForeground,
color: Theme.of(
context,
).extension<StackColors>()!.warningForeground,
),
),
),
Expand All @@ -88,10 +86,9 @@ class DeleteWalletWarningView extends ConsumerWidget {
child: Text(
"Cancel",
style: STextStyles.button(context).copyWith(
color:
Theme.of(
context,
).extension<StackColors>()!.accentColorDark,
color: Theme.of(
context,
).extension<StackColors>()!.accentColorDark,
),
),
),
Expand Down Expand Up @@ -130,18 +127,21 @@ class DeleteWalletWarningView extends ConsumerWidget {
myName: wallet.frostInfo.myName,
config: results[1]!,
keys: results[0]!,
prevGen:
results[2] == null || results[3] == null
? null
: (config: results[3]!, keys: results[2]!),
prevGen: results[2] == null || results[3] == null
? null
: (config: results[3]!, keys: results[2]!),
);
}
} else {
if (wallet is ViewOnlyOptionInterface &&
wallet.isViewOnly) {
viewOnlyData = await wallet.getViewOnlyWalletData();
} else if (wallet is MnemonicInterface) {
mnemonic = await wallet.getMnemonicAsWords();
try {
mnemonic = await wallet.getMnemonicAsWords();
} catch (_) {
// Key-restored wallets may not have a mnemonic.
}
}
}
if (context.mounted) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ class _DesktopAttentionDeleteWallet
// TODO: [prio=med] handle other types wallet deletion
// All wallets currently are mnemonic based
if (wallet is MnemonicInterface) {
final words = await wallet.getMnemonicAsWords();
List<String> words = [];
try {
words = await wallet.getMnemonicAsWords();
} catch (_) {
// Key-restored wallets may not have a mnemonic.
}

if (context.mounted) {
await Navigator.of(context).pushNamed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ class _UnlockWalletKeysDesktopState
(wallet as ViewOnlyOptionInterface).isViewOnly) {
// TODO: is something needed here?
} else {
words = await wallet.getMnemonicAsWords();
try {
words = await wallet.getMnemonicAsWords();
} catch (_) {
// Key-restored wallets may not have a mnemonic.
}
}
}

Expand Down
Loading
Loading