CODEBASE: Refactor and fix issues in db.ts (#2623)

This commit is contained in:
catloversg
2026-04-04 05:28:48 +07:00
committed by GitHub
parent 48fad72b6a
commit 2819947378
6 changed files with 100 additions and 36 deletions
+8 -4
View File
@@ -35,11 +35,15 @@ interface IProps {
}
function exportSaveFile(): void {
load()
.then((content) => {
const extension = isBinaryFormat(content) ? "json.gz" : "json";
load(true)
.then((saveData) => {
if (saveData === undefined) {
console.error("There is no save data, but the recovery mode was activated.");
return;
}
const extension = isBinaryFormat(saveData) ? "json.gz" : "json";
const filename = `RECOVERY_BITBURNER_${Date.now()}.${extension}`;
downloadContentAsFile(content, filename);
downloadContentAsFile(saveData, filename);
})
.catch((err) => {
console.error(err);