From a748e57cd776c4b789a50622eb6e562afcd69d42 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Fri, 9 Sep 2016 19:11:21 +0200 Subject: [PATCH] do not sync automatically on chat seen requests --- website/client/js/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/client/js/config.js b/website/client/js/config.js index 1c145d5475..6ac3097f42 100644 --- a/website/client/js/config.js +++ b/website/client/js/config.js @@ -13,13 +13,14 @@ angular.module('habitrpg') var isUserAvailable = $rootScope.appLoaded === true; var hasUserV = response.data && response.data.userV; var isNotSync = response.config.url.indexOf('/api/v3/user') !== 0 || response.config.method !== 'GET'; + var isNotMarkChatSeen = response.config.url.indexOf('/chat/seen') === -1; // exclude chat seen requests because with real time chat they would be too many if (isApiCall && isUserAvailable && hasUserV) { var oldUserV = $rootScope.User.user._v; $rootScope.User.user._v = response.data.userV; // Something has changed on the user object that was not tracked here, sync the user - if (isNotSync && ($rootScope.User.user._v - oldUserV) > 1) { + if (isNotMarkChatSeen && isNotSync && ($rootScope.User.user._v - oldUserV) > 1) { $rootScope.User.sync(); } }