diff options
Diffstat (limited to 'src/features/sync.js')
| -rw-r--r-- | src/features/sync.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/features/sync.js b/src/features/sync.js index 8349b5d..9e77664 100644 --- a/src/features/sync.js +++ b/src/features/sync.js @@ -37,6 +37,12 @@ export function installSyncWallet(wallet) { this.nostr.setRelays(sync.relays); return this.nostr.fetchEvents(filter, maxWait); }, + nostrSubscribe(filter, onEvent) { + const sync = getSyncConfig(); + if (this.offline || !sync.enabled) return () => {}; + this.nostr.setRelays(sync.relays); + return this.nostr.subscribeEvents(filter, onEvent); + }, // Pull the latest state from Nostr; apply it if it's newer than what we have. // Returns true if state was applied (so the caller can skip a full scan). |
