Only emit umi:ui:message_add event when we're actually generating an element.
This commit is contained in:
parent
cdabf80e1c
commit
c792faa042
1 changed files with 6 additions and 8 deletions
|
@ -11,18 +11,16 @@
|
|||
#include ui/emotes.js
|
||||
|
||||
Umi.UI.Messages = (function() {
|
||||
let forceUserInfo = false,
|
||||
lastMsgUser = null,
|
||||
lastMsgChannel = null,
|
||||
lastWasTiny = null;
|
||||
let forceUserInfo = false;
|
||||
let lastMsgUser = null;
|
||||
let lastMsgChannel = null;
|
||||
let lastWasTiny = null;
|
||||
|
||||
const title = new MamiWindowTitle({
|
||||
getName: () => futami.get('title'),
|
||||
});
|
||||
|
||||
window.addEventListener('focus', function() {
|
||||
title.clear();
|
||||
});
|
||||
window.addEventListener('focus', () => title.clear());
|
||||
|
||||
const botMsgs = {
|
||||
'say': { text: '%0' },
|
||||
|
@ -393,7 +391,7 @@ Umi.UI.Messages = (function() {
|
|||
mami.sound.library.play(soundName, soundVolume, soundRate);
|
||||
}
|
||||
|
||||
if(window.CustomEvent)
|
||||
if(eBase instanceof HTMLElement)
|
||||
window.dispatchEvent(new CustomEvent('umi:ui:message_add', {
|
||||
detail: {
|
||||
element: eBase,
|
||||
|
|
Loading…
Reference in a new issue