fix: treat missing db file as error in manual backup to prevent false success toast

backup_database_file() returning Ok(None) was silently resolved as null
on the frontend, bypassing try/catch and showing a success toast without
actually creating a backup file. Now None is converted to an explicit
Err so the frontend correctly displays an error toast.
This commit is contained in:
Jason
2026-02-26 21:53:59 +08:00
parent 54876612b3
commit 3590df68b8
2 changed files with 22 additions and 0 deletions
+4
View File
@@ -223,6 +223,10 @@ export interface BackupEntry {
}
export const backupsApi = {
async createDbBackup(): Promise<string> {
return await invoke("create_db_backup");
},
async listDbBackups(): Promise<BackupEntry[]> {
return await invoke("list_db_backups");
},