Sync more often when using the API (#1075)

This commit is contained in:
Jed Fox
2023-06-02 15:34:42 -04:00
committed by GitHub
parent a0dfb8afbd
commit 6de6ad661d
6 changed files with 23 additions and 4 deletions

View File

@@ -28,6 +28,7 @@ export async function init(config = {}) {
export async function shutdown() {
if (actualApp) {
await actualApp.send('sync');
await actualApp.send('close-budget');
actualApp = null;
}

View File

@@ -25,6 +25,10 @@ export async function downloadBudget(syncId, { password } = {}) {
return send('api/download-budget', { syncId, password });
}
export async function sync() {
return send('api/sync');
}
export async function batchBudgetUpdates(func) {
await send('api/batch-budget-start');
try {