Compare commits

..

1 Commits

Author SHA1 Message Date
user
efc299d542 fix: standardize error display to use showError/hideError helpers
All checks were successful
check / check (push) Successful in 21s
Replaces four inconsistent error display patterns with the centralized
showError()/hideError() helpers from helpers.js:

- approval.js: replace direct classList toggling on approve-tx-error and
  approve-sign-error with showError()/hideError()
- addressDetail.js: rename export-privkey-flash to export-privkey-error,
  use showError()/hideError() instead of direct DOM manipulation
- deleteWallet.js: rename delete-wallet-flash to delete-wallet-error,
  use showError()/hideError() instead of direct DOM with text-red-500
- addWallet.js: replace showFlash() validation errors with dedicated
  add-wallet-error div and showError() (keep showFlash for status msgs)
- importKey.js: replace showFlash() validation errors with dedicated
  import-key-error div and showError()
- index.html: add error divs with min-h-[1.25rem] for add-wallet,
  import-key views; update existing error divs to use consistent
  min-h-[1.25rem] class instead of hidden class

Closes #87
2026-02-28 12:49:39 -08:00
2 changed files with 21 additions and 7 deletions

View File

@@ -104,7 +104,10 @@
class="border border-border p-1 w-full font-mono text-sm bg-bg text-fg"
/>
</div>
<div id="add-wallet-error" class="text-xs mb-2 hidden"></div>
<div
id="add-wallet-error"
class="text-xs min-h-[1.25rem] mb-2"
></div>
<button
id="btn-add-wallet-confirm"
class="border border-border px-2 py-1 hover:bg-fg hover:text-bg cursor-pointer"
@@ -163,7 +166,10 @@
class="border border-border p-1 w-full font-mono text-sm bg-bg text-fg"
/>
</div>
<div id="import-key-error" class="text-xs mb-2 hidden"></div>
<div
id="import-key-error"
class="text-xs min-h-[1.25rem] mb-2"
></div>
<button
id="btn-import-key-confirm"
class="border border-border px-2 py-1 hover:bg-fg hover:text-bg cursor-pointer"
@@ -368,7 +374,7 @@
</p>
<div
id="export-privkey-error"
class="text-xs mb-2 hidden"
class="text-xs min-h-[1.25rem] mb-2"
></div>
<div id="export-privkey-password-section" class="mb-2">
<label class="block mb-1">Password</label>
@@ -940,7 +946,10 @@
<strong id="delete-wallet-name"></strong> is permanent. Any
funds will be unrecoverable without your recovery phrase.
</p>
<div id="delete-wallet-error" class="text-xs mb-2 hidden"></div>
<div
id="delete-wallet-error"
class="text-xs min-h-[1.25rem] mb-2"
></div>
<div class="mb-2">
<label class="block mb-1">Password</label>
<input
@@ -1138,7 +1147,10 @@
class="border border-border p-1 w-full font-mono text-sm bg-bg text-fg"
/>
</div>
<div id="approve-tx-error" class="text-xs hidden mb-2"></div>
<div
id="approve-tx-error"
class="text-xs min-h-[1.25rem] mb-2"
></div>
<div class="flex justify-between">
<button
id="btn-approve-tx"
@@ -1201,7 +1213,10 @@
class="border border-border p-1 w-full font-mono text-sm bg-bg text-fg"
/>
</div>
<div id="approve-sign-error" class="text-xs hidden mb-2"></div>
<div
id="approve-sign-error"
class="text-xs min-h-[1.25rem] mb-2"
></div>
<div class="flex justify-between">
<button
id="btn-approve-sign"

View File

@@ -99,7 +99,6 @@ function init(ctx) {
state.hasWallet = true;
await saveState();
ctx.renderWalletList();
hideError("add-wallet-error");
showView("main");
// Scan for used HD addresses beyond index 0.