diff --git a/src/module/rolls/check-factory.ts b/src/module/rolls/check-factory.ts index 51286e6..b98d96c 100644 --- a/src/module/rolls/check-factory.ts +++ b/src/module/rolls/check-factory.ts @@ -119,42 +119,39 @@ async function askGmModifier( const renderedHtml = await renderTemplate(usedTemplate, templateData); const dialogPromise = new Promise((resolve) => { - new Dialog( - { - title: usedTitle, - content: renderedHtml, - buttons: { - ok: { - icon: '', - label: game.i18n.localize("DS4.GenericOkButton"), - callback: (html) => { - if (!("jquery" in html)) { + new Dialog({ + title: usedTitle, + content: renderedHtml, + buttons: { + ok: { + icon: '', + label: game.i18n.localize("DS4.GenericOkButton"), + callback: (html) => { + if (!("jquery" in html)) { + throw new Error( + game.i18n.format("DS4.ErrorUnexpectedHtmlType", { + exType: "JQuery", + realType: "HTMLElement", + }), + ); + } else { + const innerForm = html[0].querySelector("form"); + if (!innerForm) { throw new Error( - game.i18n.format("DS4.ErrorUnexpectedHtmlType", { - exType: "JQuery", - realType: "HTMLElement", - }), + game.i18n.format("DS4.ErrorCouldNotFindHtmlElement", { htmlElement: "form" }), ); - } else { - const innerForm = html[0].querySelector("form"); - if (!innerForm) { - throw new Error( - game.i18n.format("DS4.ErrorCouldNotFindHtmlElement", { htmlElement: "form" }), - ); - } - resolve(innerForm); } - }, - }, - cancel: { - icon: '', - label: game.i18n.localize("DS4.GenericCancelButton"), + resolve(innerForm); + } }, }, - default: "ok", + cancel: { + icon: '', + label: game.i18n.localize("DS4.GenericCancelButton"), + }, }, - { jQuery: true }, - ).render(true); + default: "ok", + }).render(true); }); const dialogForm = await dialogPromise; return parseDialogFormData(dialogForm);