diff --git a/daggerheart.mjs b/daggerheart.mjs index de34fb69..eeed29dc 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -193,11 +193,9 @@ Hooks.on('ready', async () => { Hooks.once('dicesoniceready', () => {}); -Hooks.on('renderChatMessageHTML', (app, element, _) => { +Hooks.on('renderChatMessageHTML', (document, element) => { enricherRenderSetup(element); - // Despite documentation, the third parameter may be empty as per - // https://github.com/foundryvtt/foundryvtt/issues/11984 - const cssClass = app.flags?.daggerheart?.cssClass; + const cssClass = document.flags?.daggerheart?.cssClass; if (cssClass) cssClass.split(' ').forEach(cls => element.classList.add(cls)); }); diff --git a/module/applications/ui/chatLog.mjs b/module/applications/ui/chatLog.mjs index 8bec640b..45d9c0b3 100644 --- a/module/applications/ui/chatLog.mjs +++ b/module/applications/ui/chatLog.mjs @@ -55,10 +55,8 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo ]; } - addChatListeners = async (app, html, data) => { - // Despite documentation, the third parameter may be empty as per - // https://github.com/foundryvtt/foundryvtt/issues/11984 - const message = data?.message ?? app.toObject(false); + addChatListeners = async (document, html, data) => { + const message = data?.message ?? document.toObject(false); html.querySelectorAll('.simple-roll-button').forEach(element => element.addEventListener('click', event => this.onRollSimple(event, message)) );