Skip to content

Commit

Permalink
Fix calling modal.open() on modal confirm callback
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan committed Apr 6, 2019
1 parent aa9a1a7 commit 8fea4c9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/ui-utils/client/lib/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ export const modal = {
}
},
confirm(value) {
if (this.fn) {
this.fn(value);
} else {
this.close();
}
const { fn } = this;

this.config.closeOnConfirm && this.close();

if (fn) {
fn.call(this, value);
return;
}

this.close();
},
showInputError(text) {
const errorEl = document.querySelector('.rc-modal__content-error');
Expand Down

0 comments on commit 8fea4c9

Please sign in to comment.