mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-10 17:47:50 +02:00
CODEBASE: Refactor and fix issues in db.ts (#2623)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user