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
|
#include ui/emotes.js
|
||||||
|
|
||||||
Umi.UI.Messages = (function() {
|
Umi.UI.Messages = (function() {
|
||||||
let forceUserInfo = false,
|
let forceUserInfo = false;
|
||||||
lastMsgUser = null,
|
let lastMsgUser = null;
|
||||||
lastMsgChannel = null,
|
let lastMsgChannel = null;
|
||||||
lastWasTiny = null;
|
let lastWasTiny = null;
|
||||||
|
|
||||||
const title = new MamiWindowTitle({
|
const title = new MamiWindowTitle({
|
||||||
getName: () => futami.get('title'),
|
getName: () => futami.get('title'),
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('focus', function() {
|
window.addEventListener('focus', () => title.clear());
|
||||||
title.clear();
|
|
||||||
});
|
|
||||||
|
|
||||||
const botMsgs = {
|
const botMsgs = {
|
||||||
'say': { text: '%0' },
|
'say': { text: '%0' },
|
||||||
|
@ -393,7 +391,7 @@ Umi.UI.Messages = (function() {
|
||||||
mami.sound.library.play(soundName, soundVolume, soundRate);
|
mami.sound.library.play(soundName, soundVolume, soundRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(window.CustomEvent)
|
if(eBase instanceof HTMLElement)
|
||||||
window.dispatchEvent(new CustomEvent('umi:ui:message_add', {
|
window.dispatchEvent(new CustomEvent('umi:ui:message_add', {
|
||||||
detail: {
|
detail: {
|
||||||
element: eBase,
|
element: eBase,
|
||||||
|
|
Loading…
Reference in a new issue