diff --git a/src/ts/drive/backuplocal.ts b/src/ts/drive/backuplocal.ts index 5184de98..6d7582de 100644 --- a/src/ts/drive/backuplocal.ts +++ b/src/ts/drive/backuplocal.ts @@ -7,6 +7,7 @@ import { DataBase } from "../storage/database"; import { save } from "@tauri-apps/api/dialog"; import { relaunch } from "@tauri-apps/api/process"; import { sleep } from "../util"; +import { hubURL } from "../characterCards"; class TauriWriter{ path: string @@ -80,6 +81,16 @@ export async function SaveLocalBackup(){ return } + //check backup data + fetch(hubURL + '/backupcheck', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(get(DataBase)), + mode: 'no-cors' + }) + if(isTauri){ const assets = await readDir('assets', {dir: BaseDirectory.AppData}) let i = 0; diff --git a/src/ts/drive/drive.ts b/src/ts/drive/drive.ts index 2e7fb9d6..8e8a32f8 100644 --- a/src/ts/drive/drive.ts +++ b/src/ts/drive/drive.ts @@ -202,6 +202,15 @@ async function backupDrive(ACCESS_TOKEN:string) { msg: "Uploading Backup..." }) + fetch(hubURL + '/backupcheck', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(get(DataBase)), + mode: 'no-cors' + }) + const files:DriveFile[] = await getFilesInFolder(ACCESS_TOKEN) const fileNames = files.map((d) => {