From e66a08d18f2bef2eccfe84042a2674141a73d1c2 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 3 Mar 2026 21:40:35 -0800 Subject: bitcoin sync routine --- src/lib/bitcoinSync.ts | 13 ++++++++++++ src/routes/(app)/+layout.svelte | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 src/lib/bitcoinSync.ts (limited to 'src') diff --git a/src/lib/bitcoinSync.ts b/src/lib/bitcoinSync.ts new file mode 100644 index 00000000..9061e2fc --- /dev/null +++ b/src/lib/bitcoinSync.ts @@ -0,0 +1,13 @@ +import { post } from "$lib/utils"; + +let syncing = false; + +export const syncBitcoinVault = async (aid: string) => { + if (syncing) return; + syncing = true; + try { + return await post("/post/bitcoin/sync", { aid }); + } finally { + syncing = false; + } +}; diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index 6cbcad2b..f4d036f2 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -1,5 +1,6 @@