|
|
|
@ -61,8 +61,6 @@ export default class SiteChat {
|
|
|
|
|
this.mutedUsers = window.localStorage.mutedUsers ? JSON.parse(window.localStorage.mutedUsers) : [ ];
|
|
|
|
|
this.filterChatView();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.updateTimestamps();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async filterChatView ( ) {
|
|
|
|
@ -183,7 +181,7 @@ export default class SiteChat {
|
|
|
|
|
this.ui.isModifying = true;
|
|
|
|
|
this.ui.messageList.insertAdjacentHTML('beforeend', message.html);
|
|
|
|
|
this.trimMessages();
|
|
|
|
|
this.updateTimestamps();
|
|
|
|
|
this.app.updateTimestamps();
|
|
|
|
|
|
|
|
|
|
if (isAtBottom) {
|
|
|
|
|
/*
|
|
|
|
@ -224,7 +222,7 @@ export default class SiteChat {
|
|
|
|
|
|
|
|
|
|
this.ui.messageList.appendChild(systemMessage);
|
|
|
|
|
this.trimMessages();
|
|
|
|
|
this.updateTimestamps();
|
|
|
|
|
this.app.updateTimestamps();
|
|
|
|
|
|
|
|
|
|
if (this.ui.isAtBottom) {
|
|
|
|
|
this.ui.messageList.scrollTo(0, this.ui.messageList.scrollHeight);
|
|
|
|
@ -237,15 +235,6 @@ export default class SiteChat {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updateTimestamps ( ) {
|
|
|
|
|
const timestamps = document.querySelectorAll('[data-dtp-timestamp]');
|
|
|
|
|
timestamps.forEach((timestamp) => {
|
|
|
|
|
const created = timestamp.getAttribute('data-dtp-timestamp');
|
|
|
|
|
const format = timestamp.getAttribute('data-dtp-time-format');
|
|
|
|
|
timestamp.textContent = moment(created).format(format || 'MMM DD, YYYY, [at] hh:mm:ss a');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
createEmojiReact (message) {
|
|
|
|
|
this.ui.reactions.create(message.reaction);
|
|
|
|
|
}
|
|
|
|
|