Skip to content

Node.js based forum software built for the modern web

fixed admin js error, was trying to use socket. before it was connected

Baris Soner Usaklibfc87a81781c
diff --git a/public/src/app.js b/public/src/app.js
index 3f74008ac2..806c053444 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -98,6 +98,8 @@ var socket,
window.location.reload();
});
}
+
+ app.enter_room('global');
},
async: false
});
@@ -194,8 +196,9 @@ var socket,
app.current_room = null;
app.enter_room = function(room) {
- if (app.current_room === room) return;
-
+ if (app.current_room === room)
+ return;
+
socket.emit('event:enter_room', {
'enter': room,
'leave': app.current_room
@@ -234,9 +237,6 @@ var socket,
loadConfig();
- app.enter_room('global');
-
-
// On menu click, change "active" state
var menuEl = document.querySelector('.nav'),
liEls = menuEl.querySelectorAll('li'),