Skip to content

Commit

Permalink
pkp#10444 Use isWarnable button when using 'negative' modalStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
blesildaramirez committed Oct 7, 2024
1 parent 02eda4c commit 7fcf7ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/controllers/modal/ConfirmationModalHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,22 @@
title: options.title,
message: options.dialogText,
actions: [],
closeLegacyHandler: this.callbackWrapper(this.modalClose)
closeLegacyHandler: this.callbackWrapper(this.modalClose),
modalStyle: options.modalStyle,
};

if (options.okButton) {
this.dialogProps.actions.push({
label: options.okButton,
isWarnable: options.modalStyle === 'negative',
callback: this.callbackWrapper(this.modalConfirm)
});
}

if (options.cancelButton) {
this.dialogProps.actions.push({
label: options.cancelButton,
isWarnable: true,
isWarnable: options.modalStyle !== 'negative',
callback: this.callbackWrapper(this.modalClose)
});
}
Expand Down

0 comments on commit 7fcf7ca

Please sign in to comment.