-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
bugSomething isn't working, should be fixedSomething isn't working, should be fixedpriority: mediumMedium priority issue/pull requestMedium priority issue/pull request
Milestone
Description
In the below lines of code users can start saving the file but not successfully complete saving the file (eg: cancelling the save popup).
Notpad/src/lib/helpers/menubar/file-options.ts
Lines 241 to 250 in f28b5f5
| try { | |
| if (isTauri) await this.saveFileInTauri(saveAs); | |
| else if (typeof showSaveFilePicker != 'undefined') { | |
| await this.saveFileInDesktopBrowser(saveAs); | |
| } else await this.saveFileLegacy(); | |
| Notpad.editors.setIsSaved(Notpad.editors.getActive().id, true); | |
| } catch (err) { | |
| console.error(err); | |
| } |
In other words, there no validation that the user saved the file successfully, it just assumes, which is not best practice here. Instead it should check the status of saving process and only set Notpad.editors.setIsSaved(Notpad.editors.getActive().id, true); if it was successfully saved to local.
This can't be achieved in web browsers as stated here: https://stackoverflow.com/questions/41334881/detect-when-user-accepts-to-download-a-file
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't working, should be fixedSomething isn't working, should be fixedpriority: mediumMedium priority issue/pull requestMedium priority issue/pull request