From 5f456096566b3cc1095f1d982bb4077db4da2568 Mon Sep 17 00:00:00 2001 From: nsalyzyn Date: Sat, 20 Dec 2025 14:54:20 -0700 Subject: [PATCH] Adding suggestions from reviewer --- daggerheart.mjs | 6 ++---- module/applications/ui/chatLog.mjs | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) 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)) );