Skip to content

Commit

Permalink
fix(nag): fetch missing event on manual dismiss call
Browse files Browse the repository at this point in the history
When the dismiss function is called manually via behavior .nag('dismiss') rather than being called inside an event (like when clicking on the close icon) a JS console error occured.
  • Loading branch information
lubber-de committed Feb 11, 2024
1 parent 3ddf735 commit b3b7868
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/definitions/modules/nag.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@
module.debug('Dismissing nag', settings.storageMethod, settings.key, settings.value, settings.expires);
module.storage.set(settings.key, settings.value);
}
event.stopImmediatePropagation();
event.preventDefault();
if (event) {
event.stopImmediatePropagation();
event.preventDefault();
}
},

should: {
Expand Down

0 comments on commit b3b7868

Please sign in to comment.