From 9e86e14955e716f1b9ea92d264dbc39fe9a86f82 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 22 Oct 2026 22:52:15 -0700 Subject: 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 --- src/features/ark.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/features') 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) { -- cgit v1.2.3