aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/bitcoinSync.ts
blob: 9061e2fcb4dda91ff8f684b6a0fcb6b7d6f90ffc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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;
  }
};