diff --git a/app/javascript/controllers/application.js b/app/javascript/controllers/application.js index 6004862f..4b55996d 100644 --- a/app/javascript/controllers/application.js +++ b/app/javascript/controllers/application.js @@ -37,7 +37,17 @@ Turbo.setConfirmMethod((message) => { dialog.addEventListener( "close", () => { - resolve(dialog.returnValue === "confirm"); + const confirmed = dialog.returnValue === "confirm"; + + if (!confirmed) { + document.getElementById("turbo-confirm-title").innerHTML = + "Are you sure?"; + document.getElementById("turbo-confirm-body").innerHTML = + "You will not be able to undo this decision"; + document.getElementById("turbo-confirm-accept").innerHTML = "Confirm"; + } + + resolve(confirmed); }, { once: true }, );