🐛 Fixed Enter key not working in send email confirmation modal

no issue

- the modal wasn't overriding the default `confirm` action so an error was thrown and the confirm action not triggered when pressing <kbd>Enter</kbd> whilst the modal is shown
- resolves Sentry error `ADMIN-M`
This commit is contained in:
Kevin Ansfield 2021-06-01 17:02:31 +01:00
parent 194cf296e5
commit 2f828137ab

View File

@ -14,6 +14,18 @@ export default ModalComponent.extend({
// Allowed actions
confirm: () => {},
actions: {
confirm() {
if (this.errorMessage) {
return this.retryEmailTask.perform();
} else {
if (!this.countPaidMembersTask.isRunning) {
return this.confirmAndCheckErrorTask.perform();
}
}
}
},
countPaidMembers: action(function () {
// TODO: remove editor conditional once editors can query member counts
if (['free', 'paid'].includes(this.model.sendEmailWhenPublished) && !this.session.get('user.isEditor')) {