diff options
| author | Adam Soltys <[email protected]> | 2026-10-22 22:52:15 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-22 22:52:15 -0700 |
| commit | 9e86e14955e716f1b9ea92d264dbc39fe9a86f82 (patch) | |
| tree | 00ea03ca9b48a1cfacdfbd1ef03e543168f76c7f | |
| parent | b81de12e6f9806fe2cd8f439be5a76118b4fbced (diff) | |
| download | coinosv3-9e86e14955e716f1b9ea92d264dbc39fe9a86f82.tar.gz coinosv3-9e86e14955e716f1b9ea92d264dbc39fe9a86f82.zip | |
Spending settings: the init-time cache write keeps the last tip seen instead of zeroing it for the beat before the tip arrives
Co-Authored-By: Claude Fable 5.1 <[email protected]>
| -rw-r--r-- | src/features/ark.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/features/ark.js b/src/features/ark.js index 4b15099..df33e0f 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -475,7 +475,12 @@ export function arkFeature(ctx) { try { return url ? JSON.parse(localStorage.getItem(ARK_INFO_KEY + url) || 'null') : null; } catch { return null; } } function rememberArkInfo(url, info, tip) { - try { if (url && info) localStorage.setItem(ARK_INFO_KEY + url, JSON.stringify({ info, tip: tip || 0, at: Date.now() })); } catch {} + try { + if (!url || !info) return; + // no tip yet (right after init): keep the last one seen, dated as it was + const prev = tip ? null : cachedArkInfo(url); + localStorage.setItem(ARK_INFO_KEY + url, JSON.stringify(tip ? { info, tip, at: Date.now() } : { info, tip: (prev && prev.tip) || 0, at: (prev && prev.at) || Date.now() })); + } catch {} } // the tip, live or estimated from the last one seen (a block per ten minutes) function arkTipNow(mgr) { |
