Fixed bug with flair in chat.
This commit is contained in:
parent
ee68dba673
commit
e226d45dce
|
|
@ -112,22 +112,22 @@ class chatBox{
|
|||
highLevel.textContent = utils.unescapeEntities(`${data.highLevel}`);
|
||||
chatEntry.appendChild(highLevel);
|
||||
|
||||
//Create username label
|
||||
var userLabel = document.createElement('p');
|
||||
userLabel.classList.add("chat-panel-buffer","chat-entry-username");
|
||||
|
||||
//If we're not using classic flair
|
||||
if(data.flair != "classic"){
|
||||
//Use flair
|
||||
var flair = `flair-${data.flair}`;
|
||||
//Otherwise
|
||||
}else{
|
||||
//Pull user's assigned color from the color map
|
||||
var flair = this.client.userList.colorMap.get(data.user);
|
||||
}
|
||||
|
||||
//Create color span
|
||||
var colorSpan = document.createElement('span');
|
||||
colorSpan.classList.add("chat-entry-flair-span", flair);
|
||||
colorSpan.textContent = utils.unescapeEntities(`${data.user}`);
|
||||
userLabel.textContent = utils.unescapeEntities(`${colorSpan.outerHTML}: `);
|
||||
//Create username label
|
||||
var userLabel = document.createElement('p');
|
||||
userLabel.classList.add("chat-panel-buffer", "chat-entry-username", flair);
|
||||
userLabel.textContent = utils.unescapeEntities(data.user)
|
||||
|
||||
//Append user label
|
||||
chatEntry.appendChild(userLabel);
|
||||
|
||||
//Create chat body
|
||||
|
|
|
|||
Loading…
Reference in a new issue