mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 18:26:15 +01:00
added logic to handle Chats.switchChat being called with no arguments
This commit is contained in:
@@ -58,6 +58,10 @@ define('forum/chats', [
|
||||
Chats.addScrollHandler(ajaxify.data.roomId, ajaxify.data.uid, $('.chat-content'));
|
||||
Chats.addCharactersLeftHandler($('[component="chat/main-wrapper"]'));
|
||||
Chats.addIPHandler($('[component="chat/main-wrapper"]'));
|
||||
|
||||
$('[data-action="close"]').on('click', function () {
|
||||
Chats.switchChat();
|
||||
});
|
||||
};
|
||||
|
||||
Chats.addIPHandler = function (container) {
|
||||
@@ -385,6 +389,11 @@ define('forum/chats', [
|
||||
};
|
||||
|
||||
Chats.switchChat = function (roomid) {
|
||||
// Allow empty arg for return to chat list/close chat
|
||||
if (!roomid) {
|
||||
roomid = '';
|
||||
}
|
||||
|
||||
var url = 'user/' + ajaxify.data.userslug + '/chats/' + roomid;
|
||||
if (self.fetch) {
|
||||
fetch(config.relative_path + '/api/' + url, { credentials: 'include' })
|
||||
|
||||
Reference in New Issue
Block a user