Skip to content

Commit 81fbf90

Browse files
committed
🛠️ Added an arg to disable forced save when exporting
#195
1 parent 248357a commit 81fbf90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/systems/exporter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { renderRig, hashRig } from './rigRenderer'
1212

1313
export class IntentionalExportError extends Error {}
1414

15-
async function actuallyExportProject() {
15+
async function actuallyExportProject(forceSave = true) {
1616
const aj = Project!.animated_java
1717
const dialog = openExportProgressDialog()
1818
// Wait for the dialog to open
@@ -88,7 +88,7 @@ async function actuallyExportProject() {
8888
Project!.last_used_export_namespace = aj.export_namespace
8989
console.timeEnd('Exporting project took')
9090

91-
saveBlueprint()
91+
if (forceSave) saveBlueprint()
9292
dialog.close(0)
9393
Blockbench.showQuickMessage('Project exported successfully!', 2000)
9494
} catch (e: any) {
@@ -106,7 +106,7 @@ async function actuallyExportProject() {
106106
}
107107
}
108108

109-
export async function exportProject() {
109+
export async function exportProject(forceSave = true) {
110110
if (!Project) return // TODO: Handle this error better
111111
blueprintSettingErrors.set({})
112112
const settingsDialog = openBlueprintSettingsDialog()!
@@ -133,5 +133,5 @@ export async function exportProject() {
133133
}
134134

135135
settingsDialog.close(0)
136-
await actuallyExportProject()
136+
await actuallyExportProject(forceSave)
137137
}

0 commit comments

Comments
 (0)