Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure files are actually saved on tauri #281

Open
Muhammed-Rahif opened this issue Dec 18, 2024 · 2 comments
Open

Ensure files are actually saved on tauri #281

Muhammed-Rahif opened this issue Dec 18, 2024 · 2 comments
Labels
bug Something isn't working, should be fixed priority: medium Medium priority issue/pull request
Milestone

Comments

@Muhammed-Rahif
Copy link
Owner

In the below lines of code users can start saving the file but not successfully complete saving the file (eg: cancelling the save popup).

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

Copy link
Contributor

👋 Hi @Muhammed-Rahif! Thank you for taking the time to report an issue in Notpad.
We’ll dive into it shortly. 🕵️‍♂️🔧
While you're here, why not add a ⭐ to the repo? Click here to star.
Your support helps us grow this project and reach more awesome contributors like you! 🚀

@Muhammed-Rahif Muhammed-Rahif added bug Something isn't working, should be fixed priority: medium Medium priority issue/pull request labels Dec 18, 2024
@Muhammed-Rahif Muhammed-Rahif added this to the v1.0 milestone Dec 18, 2024
@Abdullanabdulaziz
Copy link

Hi, I’d like to work on this issue. Could you assign it to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, should be fixed priority: medium Medium priority issue/pull request
Projects
None yet
Development

No branches or pull requests

2 participants