[feat] add backupcheck process
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user