Merge pull request #3295 from juan-cortizas-ponte/1.11.x.chat-add-try-catch-on-ajax-done

added try/catch on chat done callback
pull/3312/head
Julio Montoya 5 years ago committed by GitHub
commit c8f7ceba81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      main/template/default/chat/chat.tpl

@ -81,6 +81,7 @@ $(function () {
friend: ChChat.currentFriend friend: ChChat.currentFriend
}) })
.done(function (response) { .done(function (response) {
try {
if (response.data.history) { if (response.data.history) {
ChChat._historySize = response.data.oldFileSize; ChChat._historySize = response.data.oldFileSize;
ChChat.setHistory(response.data.history); ChChat.setHistory(response.data.history);
@ -90,6 +91,9 @@ $(function () {
ChChat.usersOnline = response.data.usersOnline; ChChat.usersOnline = response.data.usersOnline;
ChChat.setConnectedUsers(response.data.userList); ChChat.setConnectedUsers(response.data.userList);
} }
} catch (error) {
console.error(error);
}
}); });
}, },
setHistory: function (messageList) { setHistory: function (messageList) {

Loading…
Cancel
Save