From 886cd38a9b4c91328859ff9097cadab6a9927c8e Mon Sep 17 00:00:00 2001 From: clawbot Date: Sat, 28 Feb 2026 13:08:02 -0800 Subject: [PATCH] fix: disable export-privkey and delete-wallet buttons during async processing Closes #86 --- src/popup/views/addressDetail.js | 6 ++++++ src/popup/views/deleteWallet.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/popup/views/addressDetail.js b/src/popup/views/addressDetail.js index 49c627e..2deb222 100644 --- a/src/popup/views/addressDetail.js +++ b/src/popup/views/addressDetail.js @@ -325,6 +325,9 @@ function init(_ctx) { $("export-privkey-flash").classList.remove("hidden"); return; } + const btn = $("btn-export-privkey-confirm"); + btn.disabled = true; + btn.classList.add("text-muted"); const wallet = state.wallets[state.selectedWallet]; try { const secret = await decryptWithPassword( @@ -344,6 +347,9 @@ function init(_ctx) { } catch { $("export-privkey-flash").textContent = "Wrong password."; $("export-privkey-flash").classList.remove("hidden"); + } finally { + btn.disabled = false; + btn.classList.remove("text-muted"); } }); diff --git a/src/popup/views/deleteWallet.js b/src/popup/views/deleteWallet.js index 49e47bf..21cc2ea 100644 --- a/src/popup/views/deleteWallet.js +++ b/src/popup/views/deleteWallet.js @@ -40,6 +40,10 @@ function init(_ctx) { return; } + const btn = $("btn-delete-wallet-confirm"); + btn.disabled = true; + btn.classList.add("text-muted"); + const walletIdx = deleteWalletIndex; const wallet = state.wallets[walletIdx]; @@ -49,6 +53,8 @@ function init(_ctx) { } catch (_e) { $("delete-wallet-flash").textContent = "Wrong password."; $("delete-wallet-flash").classList.remove("hidden"); + btn.disabled = false; + btn.classList.remove("text-muted"); return; }