Closed nstr10 closed 4 years ago
Based on this the file extension should be ".json": https://github.com/mike-goodwin/owasp-threat-dragon-desktop/blob/f94e1df4e1f5f881fc38b1b03aea36d1bdecf068/app/services/electron.js#L43-L51 I'm not sure if a custom check should be written or if there is a native Node/Electron way of doing this.
Thanks @nstr10 - I have checked this on my debian Linux and see the same thing. On MacOS and Windows it prompts with 'Untitled.json' but not Linux. If you can get a fix for this that would be great, otherwise I can have a look later in the week.
Hello @nstr10 , just committed a fix where defaultPath: "new-model.json",
is applied, so if you update your checkout and run it again it should work OK
@jgadsden that definitely helps a lot, but the behavior is still a bit unusual if you don't take the default filename. For example, if I save a file as test
it doesn't get the .json
extension and therefore the open
dialog does not show it. Compounding this issue, at least in Nautilus, the extension is not actually shown in the file type menu.
I'll do some research into Electron this weekend and try to make a pull request.
Thanks @nstr10 , you make a very good point. I have reopened this issue, and if you can get a fix then that would be great.
Submitted a workaround for the open dialog. It looks like the issue with the save dialog is being debated upstream: https://github.com/electron/electron/issues/21935
When saving a new file, no file extension is added. It is unclear what file extension should be added. When opening files, none appear available because they have no file extensions.
I am running this on Ubuntu 18.04 with the Nautilus file browser.