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. 20
      main/template/default/chat/chat.tpl

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

Loading…
Cancel
Save