aboutsummaryrefslogtreecommitdiffstats
path: root/src/api.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-17 14:44:26 -0700
committerAdam Soltys <[email protected]>2026-08-17 14:44:26 -0700
commit00a0be5fcd8157f145c63df44982b4f74960c815 (patch)
tree8a1bf48d3f36c907a162fa592c085681f33a6c28 /src/api.js
parenta2ff81a9389e2301255f3d1c6362e596d9def4ea (diff)
downloadcoinosv3-00a0be5fcd8157f145c63df44982b4f74960c815.tar.gz
coinosv3-00a0be5fcd8157f145c63df44982b4f74960c815.zip
A snapshot only counts on its own network: the seed-keyed cache stops showing mainnet money under a mutinynet flag, and staging forgives the mainnet default it stamped before it knew better
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz
Diffstat (limited to 'src/api.js')
-rw-r--r--src/api.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/api.js b/src/api.js
index c020a0c..5917234 100644
--- a/src/api.js
+++ b/src/api.js
@@ -31,6 +31,17 @@ export function setExplorerConfig({ server, url }, net = getNetwork()) {
// blocks) for testing — same address format as testnet, its own explorer at
// mutinynet.com. Data-source choices are stored per network (see nk()).
const NETWORK_KEY = 'btc-wallet-network';
+// Staging's default is mutinynet, but a "mainnet" stored BEFORE the staging
+// flag existed would pin early testers to mainnet forever. Clear it once —
+// anyone who picks mainnet on staging after this keeps their choice.
+if (STAGING) {
+ try {
+ if (!localStorage.getItem(NETWORK_KEY + '-staged')) {
+ localStorage.setItem(NETWORK_KEY + '-staged', '1');
+ if (localStorage.getItem(NETWORK_KEY) === 'mainnet') localStorage.removeItem(NETWORK_KEY);
+ }
+ } catch {}
+}
export const NETWORKS = [
{ id: 'mainnet', label: 'Mainnet' },
{ id: 'testnet', label: 'Testnet' },