aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/app.js b/src/app.js
index c64c650..e59b1bd 100644
--- a/src/app.js
+++ b/src/app.js
@@ -391,9 +391,12 @@ async function enterWallet(mnemonic, passphrase) {
return;
}
try {
- // With a cache, only check the live frontier (cheap) instead of a full
- // re-scan; a full scan still runs for a brand-new wallet and periodically.
- if (hadCache) await wallet.refreshLive();
+ // Cross-device state: pull the latest from Nostr (may supply state on a
+ // device with no local cache, or a newer copy from another device).
+ const hadNostr = await wallet.syncFromNostr();
+ // With existing state (local or remote), only check the live frontier;
+ // a brand-new wallet does one full scan.
+ if (hadCache || hadNostr) await wallet.refreshLive();
else await wallet.scan();
wallet.startRealtime();
} catch {