Commit 8fda49ff authored by Paul Slaughter's avatar Paul Slaughter
parent a2204ab2
import Rails from '@rails/ujs'; import Rails from '@rails/ujs';
import { confirmViaGlModal } from './confirm_via_gl_modal/confirm_via_gl_modal'; import { confirmViaGlModal } from './confirm_via_gl_modal/confirm_via_gl_modal';
import { ignoreWhilePending } from './ignore_while_pending';
function monkeyPatchConfirmModal() { function monkeyPatchConfirmModal() {
/** /**
...@@ -18,8 +19,10 @@ function monkeyPatchConfirmModal() { ...@@ -18,8 +19,10 @@ function monkeyPatchConfirmModal() {
* @param element {HTMLElement} Element that was clicked on * @param element {HTMLElement} Element that was clicked on
* @returns {boolean} * @returns {boolean}
*/ */
const safeConfirm = ignoreWhilePending(confirmViaGlModal);
function confirmViaModal(message, element) { function confirmViaModal(message, element) {
confirmViaGlModal(message, element) safeConfirm(message, element)
.then((confirmed) => { .then((confirmed) => {
if (confirmed) { if (confirmed) {
Rails.confirm = () => true; Rails.confirm = () => true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment