Skip to content

Commit 1a899d1

Browse files
DuddinoDuddino Gatto
andauthored
Fix export modals (#621)
Co-authored-by: Duddino Gatto <duddinogatto@pm.me>
1 parent 2574a27 commit 1a899d1

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

scripts/dashboard/Dashboard.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ const transferAmount = ref('');
9191
const showRestoreWallet = ref(false);
9292
const restoreWalletReason = ref('');
9393
const importLock = ref(false);
94-
watch(showExportModal, async (showExportModal) => {
95-
if (showExportModal) {
94+
watch(showExportModal, async () => {
95+
if (showExportModal.value) {
96+
if (isViewOnly.value && !(await restoreWallet())) {
97+
showExportModal.value = false;
98+
return;
99+
}
96100
keyToBackup.value = await activeWallet.value.getKeyToBackup();
97101
} else {
98102
// Wipe key to backup, just in case

scripts/wallet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ export class Wallet {
566566
const account = await (
567567
await Database.getInstance()
568568
).getAccount(this.getKeyToExport());
569-
return account.encWif;
569+
if (account?.encWif) return account.encWif;
570570
}
571571
return this.getKeyToEncrypt();
572572
}

0 commit comments

Comments
 (0)