diff --git a/daggerheart.mjs b/daggerheart.mjs index 6aeb4b47..7d9e3e43 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -197,7 +197,7 @@ Hooks.on('renderChatMessageHTML', (app, element, _) => { enricherRenderSetup(element); // Despite documentation, the third parameter may be empty as per // https://github.com/foundryvtt/foundryvtt/issues/11984 - const message = app._source; + const message = app.toObject(false); const cssClass = message.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 0143257f..a9313110 100644 --- a/module/applications/ui/chatLog.mjs +++ b/module/applications/ui/chatLog.mjs @@ -58,7 +58,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo addChatListeners = async (app, html, _) => { // Despite documentation, the third parameter may be empty as per // https://github.com/foundryvtt/foundryvtt/issues/11984 - const message = app._source; + const message = app.toObject(false); html.querySelectorAll('.simple-roll-button').forEach(element => element.addEventListener('click', event => this.onRollSimple(event, message)) );