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

Always send 'dialog-dismissed' when clicking outside the dialog #385

Merged
merged 1 commit into from
Mar 27, 2018

Conversation

bitowl
Copy link
Contributor

@bitowl bitowl commented Mar 27, 2018

Open a dialog and then click the confirm button.
Then reopen that dialog, but this time cancel it by clicking outside.
Then the dialog-confirmed message is send.

In my case I want to do a destructive operation on confirmation, so clicking outside should imho always result in dismissing the dialog.

This is due to setting the
When clicking the dialog-confirm button closingReasonConfirmed of the dialog is set to true (https://github.com/nodecg/nodecg/blob/master/src/dashboard/js/dialog_helper.js#L17) but not reset once the dialog is opened again.

My proposed fix is to test that the dialog is not canceled before send the dialog-confirmed event.

If you confirmed the dialog first, then reopened it and canceled it by clicking outside, the 'dialog-confirmed' message would be send again.
@Abrahamic-God Abrahamic-God merged commit da30fe1 into nodecg:master Mar 27, 2018
@bitowl bitowl deleted the dismiss-dialog-on-cancel branch April 1, 2018 16:31
@github-actions github-actions bot mentioned this pull request Jan 21, 2025
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

Successfully merging this pull request may close these issues.

1 participant