Skip to content

Commit

Permalink
fix(dashboard): always send 'dialog-dismissed' when clicking outside …
Browse files Browse the repository at this point in the history
…the dialog (#385)

If you confirmed the dialog first, then reopened it and canceled it by clicking outside, the 'dialog-confirmed' message would be send again.
  • Loading branch information
bitowl authored and astral-arsonist committed Mar 27, 2018
1 parent fc62adf commit da30fe1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dashboard/elements/ncg-dialog.js
Expand Up @@ -109,7 +109,7 @@ class NcgDialog extends Polymer.mixinBehaviors([

_onIronOverlayClosed(e) {
const iframeDocument = this.querySelector('iframe').contentDocument;
if (e.detail.confirmed) {
if (e.detail.confirmed && !e.detail.canceled) {
iframeDocument.dispatchEvent(new CustomEvent('dialog-confirmed'));
} else {
iframeDocument.dispatchEvent(new CustomEvent('dialog-dismissed'));
Expand Down

0 comments on commit da30fe1

Please sign in to comment.