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

fix(sltt-app): handle passage document saving when closing window #30

Open
ericpyle opened this issue Aug 31, 2024 · 1 comment
Open

Comments

@ericpyle
Copy link
Collaborator

ericpyle commented Aug 31, 2024

Basically we need better support for saving passage documents during closing sltt-app window as we did for https://github.com/ubsicap/sltt/issues/914).

This react electron-agnostic approach seems promising. Start here: https://stackoverflow.com/a/71339813/24056785

Alternatively, perhaps in sltt-app on close we can just have a dialog that says "Saving changes..." which stays up until the changes are saved, then the app is allowed to close? How does the main process know when the app is ready to close? (We could use ipc communication.)

See other suggestions in https://stackoverflow.com/questions/45827709/confirm-beforeunload-in-electron

@EllisBenus EllisBenus self-assigned this Nov 6, 2024
@EllisBenus
Copy link
Collaborator

Fixed this by adding a showMessageBox tied to the will-prevent-unload action.

2024-11-08.SLTT.Electron.App.Save.Unsaved.Work.Before.Close.mp4

@EllisBenus EllisBenus assigned ericpyle and unassigned EllisBenus Nov 8, 2024
ericpyle added a commit that referenced this issue Nov 11, 2024
)

What issue(s) is this trying to resolve?
* fix(sltt-app): handle passage document saving when closing window #30
#30

How does it all work?
* Added `win.webContents.on('will-prevent-unload'` to `showMessageBox`
dialog

Steps for testing
1. See steps in
ubsicap/sltt#1028 (comment)

ticket: #30
commit-convention: https://www.conventionalcommits.org/en/v1.0.0/

---------

Co-authored-by: Ellis Benus <[email protected]>
Co-authored-by: Eric <[email protected]>
@ericpyle ericpyle removed their assignment Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants