summaryrefslogtreecommitdiffstats
path: root/web/react/utils/async_client.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-10-02 08:45:38 -0400
committerJoram Wilander <jwawilander@gmail.com>2015-10-02 08:45:38 -0400
commit08d390953a822371380b4264c3fb4cf891440995 (patch)
treef5f38c6fa649aa206fc751290b8a588fd1da9828 /web/react/utils/async_client.jsx
parentfbbee5bf614c1cbce5a4beb02d553b3261c8d749 (diff)
parentc9a0030551f289241407743fbd21080cd8a358a4 (diff)
downloadchat-08d390953a822371380b4264c3fb4cf891440995.tar.gz
chat-08d390953a822371380b4264c3fb4cf891440995.tar.bz2
chat-08d390953a822371380b4264c3fb4cf891440995.zip
Merge pull request #881 from hmhealey/plt194
PLT-194 Changes to ChannelMember notification settings
Diffstat (limited to 'web/react/utils/async_client.jsx')
-rw-r--r--web/react/utils/async_client.jsx16
1 files changed, 9 insertions, 7 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index ab2965000..7db3ef30d 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -152,21 +152,23 @@ export function getChannel(id) {
}
export function updateLastViewedAt() {
- if (isCallInProgress('updateLastViewed')) {
+ const channelId = ChannelStore.getCurrentId();
+
+ if (channelId === null) {
return;
}
- if (ChannelStore.getCurrentId() == null) {
+ if (isCallInProgress(`updateLastViewed${channelId}`)) {
return;
}
- callTracker.updateLastViewed = utils.getTimestamp();
+ callTracker[`updateLastViewed${channelId}`] = utils.getTimestamp();
client.updateLastViewedAt(
- ChannelStore.getCurrentId(),
- function updateLastViewedAtSuccess() {
+ channelId,
+ () => {
callTracker.updateLastViewed = 0;
},
- function updateLastViewdAtFailure(err) {
+ (err) => {
callTracker.updateLastViewed = 0;
dispatchError(err, 'updateLastViewedAt');
}
@@ -634,4 +636,4 @@ export function getMyTeam() {
dispatchError(err, 'getMyTeam');
}
);
-} \ No newline at end of file
+}