mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 21:30:17 +08:00
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:
@@ -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");
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user