mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 16:09:03 +01:00
Cleaned up with ui.chat methods
This commit is contained in:
parent
f13fced52d
commit
c5a58f3fdc
1 changed files with 2 additions and 2 deletions
|
|
@ -48,9 +48,9 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
super._onUpdate(changes, options, userId);
|
super._onUpdate(changes, options, userId);
|
||||||
|
|
||||||
const lastMessage = Array.from(game.messages).sort((a, b) => b.timestamp - a.timestamp)[0];
|
const lastMessage = Array.from(game.messages).sort((a, b) => b.timestamp - a.timestamp)[0];
|
||||||
if (lastMessage.id === this.id) {
|
if (lastMessage.id === this.id && ui.chat.isAtBottom) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.querySelector('.chat-scroll').scrollTop = 0x7fffffbf;
|
ui.chat.scrollBottom();
|
||||||
}, 5);
|
}, 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue