mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
fix: client side js crash
This commit is contained in:
@@ -32,8 +32,14 @@ define('forum/chats', [
|
|||||||
|
|
||||||
$(window).on('action:ajaxify.start', function () {
|
$(window).on('action:ajaxify.start', function () {
|
||||||
Chats.destroyAutoComplete(ajaxify.data.roomId);
|
Chats.destroyAutoComplete(ajaxify.data.roomId);
|
||||||
socket.emit('modules.chats.leave', ajaxify.data.roomId);
|
if (ajaxify.data.template.chats) {
|
||||||
socket.emit('modules.chats.leavePublic', ajaxify.data.publicRooms.map(r => r.roomId));
|
if (ajaxify.data.roomId) {
|
||||||
|
socket.emit('modules.chats.leave', ajaxify.data.roomId);
|
||||||
|
}
|
||||||
|
if (ajaxify.data.publicRooms) {
|
||||||
|
socket.emit('modules.chats.leavePublic', ajaxify.data.publicRooms.map(r => r.roomId));
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Chats.init = function () {
|
Chats.init = function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user