diff --git a/files/assets/js/chat.js b/files/assets/js/chat.js
index 65e21c00c4..266e0554ae 100644
--- a/files/assets/js/chat.js
+++ b/files/assets/js/chat.js
@@ -198,10 +198,10 @@ socket.on('online', function(data){
patron = ` class="patron" style="background-color:#${u[2]}"`
online += `
`
- if (admin_level && Object.keys(data[1]).includes(u[0].toLowerCase()))
+ if (admin_level && Object.keys(data[1]).includes(u[1].toLowerCase()))
online += 'X '
- online += `
${u[0]}`
- online2 += `
@${u[0]}`
+ online += `
${u[1]}`
+ online2 += `
@${u[1]}`
}
const online_el = document.getElementById('online')
diff --git a/files/routes/chat.py b/files/routes/chat.py
index c019378f4a..71ad6d0742 100644
--- a/files/routes/chat.py
+++ b/files/routes/chat.py
@@ -200,7 +200,7 @@ def refresh_online():
def remove_from_online(v):
for li in online.values():
for entry in li:
- if entry[1] == v.id:
+ if entry[0] == v.id:
li.remove(entry)
@socketio.on('connect')
@@ -217,7 +217,7 @@ def connect(v):
remove_from_online(v)
- online[g.referrer].append([v.username, v.id, v.name_color, v.patron])
+ online[g.referrer].append([v.id, v.username, v.name_color, v.patron])
refresh_online()