Saving a bit on resources in the chat callback

This commit is contained in:
nsalyzyn 2025-12-20 14:47:24 -07:00
parent bb5e58d3e7
commit f131dc4ec0

View file

@ -55,10 +55,10 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
];
}
addChatListeners = async (app, html, _) => {
addChatListeners = async (app, html, data) => {
// Despite documentation, the third parameter may be empty as per
// https://github.com/foundryvtt/foundryvtt/issues/11984
const message = app.toObject(false);
const message = data?.message ?? app.toObject(false);
html.querySelectorAll('.simple-roll-button').forEach(element =>
element.addEventListener('click', event => this.onRollSimple(event, message))
);