summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-08-16 14:52:40 -0400
committerChristopher Speller <crspeller@gmail.com>2016-08-16 14:52:40 -0400
commitad6363079d607e27b93073c369cbbfbb3978dc1f (patch)
treef0774738a192ec06622e782210035e177572e4b1 /webapp/utils
parent8203fd16ce3356d69b0cc51287d0a1fc25318b2d (diff)
downloadchat-ad6363079d607e27b93073c369cbbfbb3978dc1f.tar.gz
chat-ad6363079d607e27b93073c369cbbfbb3978dc1f.tar.bz2
chat-ad6363079d607e27b93073c369cbbfbb3978dc1f.zip
Correctly reset tracker for updateLastViewedAt and other asynchronous calls (#3801)
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/async_client.jsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index 674741b82..55f43fd57 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -133,11 +133,11 @@ export function updateLastViewedAt(id) {
Client.updateLastViewedAt(
channelId,
() => {
- callTracker.updateLastViewed = 0;
+ callTracker[`updateLastViewed${channelId}`] = 0;
ErrorStore.clearLastError();
},
(err) => {
- callTracker.updateLastViewed = 0;
+ callTracker[`updateLastViewed${channelId}`] = 0;
var count = ErrorStore.getConnectionErrorCount();
ErrorStore.setConnectionErrorCount(count + 1);
dispatchError(err, 'updateLastViewedAt');
@@ -170,11 +170,11 @@ export function setLastViewedAt(lastViewedAt, id) {
channelId,
lastViewedAt,
() => {
- callTracker.setLastViewedAt = 0;
+ callTracker[`setLastViewedAt${channelId}${lastViewedAt}`] = 0;
ErrorStore.clearLastError();
},
(err) => {
- callTracker.setLastViewedAt = 0;
+ callTracker[`setLastViewedAt${channelId}${lastViewedAt}`] = 0;
var count = ErrorStore.getConnectionErrorCount();
ErrorStore.setConnectionErrorCount(count + 1);
dispatchError(err, 'setLastViewedAt');
@@ -1190,6 +1190,7 @@ export function getRecentAndNewUsersAnalytics(teamId) {
teamId,
stats
});
+ callTracker[callName] = 0;
},
(err) => {
callTracker[callName] = 0;