♻️ Refactor synchronization service

This commit is contained in:
2026-03-30 00:03:23 +08:00
parent 34c8f2a185
commit 4c5fff5390
42 changed files with 4377 additions and 3199 deletions

View File

@@ -0,0 +1,25 @@
import { defineStore } from 'pinia';
import { ref } from 'vue';
import { SyncService } from '@/../bindings/voidraft/internal/services';
export const useSyncStore = defineStore('sync', () => {
const isSyncing = ref(false);
const sync = async (): Promise<void> => {
if (isSyncing.value) {
return;
}
isSyncing.value = true;
try {
await SyncService.Sync();
} finally {
isSyncing.value = false;
}
};
return {
isSyncing,
sync
};
});