From 9bf2d75bce37390111a9a3fc7dafef92d128cef3 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 5 Sep 2022 10:57:11 +0200 Subject: [PATCH] fix chat hats --- files/assets/js/chat.js | 3 +++ files/templates/chat.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/files/assets/js/chat.js b/files/assets/js/chat.js index ba6f918df..8c80c4eb3 100644 --- a/files/assets/js/chat.js +++ b/files/assets/js/chat.js @@ -82,6 +82,9 @@ socket.on('speak', function(json) { document.getElementsByClassName('avatar-pic')[0].src = json['avatar'] if (json['hat']) document.getElementsByClassName('avatar-hat')[0].src = json['hat'] + "?v=3" + else + document.getElementsByClassName('avatar-hat')[0].removeAttribute("src") + document.getElementsByClassName('userlink')[0].href = '/@' + json['username'] document.getElementsByClassName('userlink')[0].style.color = '#' + json['namecolor'] document.getElementsByClassName('time')[0].classList.remove('d-none') diff --git a/files/templates/chat.html b/files/templates/chat.html index bd81357c9..9ab09ad41 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -222,6 +222,6 @@ - + \ No newline at end of file