Skip to content

Commit 59d16d0

Browse files
committed
AF-286 Fix file save name regression
1 parent b2ceaaa commit 59d16d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/attack_flow_builder/src/assets/scripts/Application/Commands/FileManagement/SaveDiagramFileToDevice.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export class SaveDiagramFileToDevice extends GroupCommand {
2020
// Serialize file
2121
const json = JSON.stringify(file, null, 4);
2222
// Save file
23-
this.add(new SaveFileToDevice(editor.name, Configuration.file_type_extension, json));
23+
const nameProperty = editor.file?.canvas.properties.value.get("name");
24+
const fileName = nameProperty ? nameProperty.toString() : "Untitled Document";
25+
// ?? "Untitled Document";
26+
this.add(new SaveFileToDevice(fileName, Configuration.file_type_extension, json));
2427
this.add(new RemoveFileFromRecoveryBank(context, editor.id));
2528
}
2629

0 commit comments

Comments
 (0)