Fixed bug with flair in chat.

This commit is contained in:
rainbow napkin 2025-04-15 05:40:42 -04:00
parent ee68dba673
commit e226d45dce

View file

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