You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

22 lines
689 B

/**
* @file DatabaseBackupService.ts
* @description Web-specific implementation of the DatabaseBackupService
* @author Matthew Raymer
* @version 1.0.0
*/
import { DatabaseBackupService } from "../../DatabaseBackupService";
export default class WebDatabaseBackupService extends DatabaseBackupService {
protected async handleBackup(blob: Blob): Promise<void> {
// Web platform handling
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `database-backup-${new Date().toISOString()}.json`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
}