aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-25 16:05:36 -0700
committerAdam Soltys <[email protected]>2026-06-25 16:05:36 -0700
commit656a8110d30fb0774902dbd6e92c173f5f6b072c (patch)
tree1f2b4a5afed04020f1b71fbbc8664fce726faa8f
parent124fee3c15556d62d6efd8714fd4501e95273ebd (diff)
downloadcoinosv3-656a8110d30fb0774902dbd6e92c173f5f6b072c.tar.gz
coinosv3-656a8110d30fb0774902dbd6e92c173f5f6b072c.zip
Gift claim: show a loading screen while checking, not the claimable amount
Avoids flashing 'You've been sent Bitcoin' before flipping to 'Already claimed' for a spent gift. Offline fallback clears the checking flag so the loader can't hang. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
-rw-r--r--src/app.js15
-rw-r--r--src/i18n.js1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/app.js b/src/app.js
index 47f37fa..5ea8eec 100644
--- a/src/app.js
+++ b/src/app.js
@@ -856,6 +856,7 @@ function enterOfflineFallback() {
wallet.setOffline(true);
wallet.deriveWindow(40);
ui.offlineFallback = true;
+ ui.claimChecking = false; // can't verify a gift offline; don't hang on the loader
ui.tab = 'settings';
render();
}
@@ -1518,6 +1519,20 @@ function claimScreen() {
)
);
}
+ // While verifying the gift is still unclaimed, show a loading screen rather
+ // than flashing the claimable amount (which would then jump to "already
+ // claimed" for a spent gift).
+ if (ui.claimChecking) {
+ return h(
+ 'div',
+ { class: 'col', style: 'gap:16px' },
+ brandHeader(false),
+ h('div', { class: 'card col', style: 'align-items:center;text-align:center;gap:14px;padding:32px 14px' },
+ h('span', { class: 'spinner' }),
+ h('p', { class: 'muted', style: 'margin:0' }, t('giftChecking'))
+ )
+ );
+ }
// Already claimed (funding coin spent, possibly only in the mempool) — show a
// dead end with a link to the claim, instead of a claimable amount.
if (ui.claimTaken) {
diff --git a/src/i18n.js b/src/i18n.js
index 65171f7..2a52d22 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -207,6 +207,7 @@ const STR = {
giftSplitFirst: 'Split a coin first',
giftLockWhole: 'Lock the whole coin ({n})',
giftSplitFailed: 'Could not split the coin.',
+ giftChecking: 'Opening your gift…',
giftTakenTitle: 'Already claimed',
giftTakenBody: 'Sorry, this gift has already been claimed.',
giftHistoryTitle: 'Gift link',