Function: handleSQLiteBackupDownload()
handleSQLiteBackupDownload(
downloadFunction: () =>Promise<SerializedDatabaseBackupResult>):Promise<void>
Defined in: src/stores/sites/utils/fileDownload.ts:307
Handles downloading SQLite backup data as a file.
Parametersโ
downloadFunctionโ
() => Promise<SerializedDatabaseBackupResult>
Async function resolving to a serialized backup payload from the Electron main process.
Returnsโ
Promise<void>
Remarksโ
This function retrieves backup data using the provided function, validates it, and triggers a browser download. The download is performed using a Blob and anchor element with proper object URL lifecycle management.
Exampleโ
await handleSQLiteBackupDownload(() => fetchBackupData());
Throwsโ
TypeError if the backup data fails validation.
Throwsโ
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Error if the download fails due to browser API or DOM errors.