From 6a1755d2e32c3f3bcaa67c33f32cb5eb5ab76ea2 Mon Sep 17 00:00:00 2001
From: =Corey Hulen <corey@hulen.com>
Date: Fri, 16 Oct 2015 09:10:54 -0700
Subject: Inital support for multi-tab loging

---
 web/react/utils/async_client.jsx | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

(limited to 'web/react/utils/async_client.jsx')

diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index 1bf8a6fee..379c2fc19 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -3,6 +3,7 @@
 
 var client = require('./client.jsx');
 var AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
+var BrowserStore = require('../stores/browser_store.jsx');
 var ChannelStore = require('../stores/channel_store.jsx');
 var PostStore = require('../stores/post_store.jsx');
 var UserStore = require('../stores/user_store.jsx');
@@ -50,18 +51,18 @@ export function getChannels(force, updateLastViewed, checkVersion) {
         callTracker.getChannels = utils.getTimestamp();
 
         client.getChannels(
-            function getChannelsSuccess(data, textStatus, xhr) {
+            (data, textStatus, xhr) => {
                 callTracker.getChannels = 0;
 
                 if (checkVersion) {
                     var serverVersion = xhr.getResponseHeader('X-Version-ID');
 
-                    if (!UserStore.getLastVersion()) {
-                        UserStore.setLastVersion(serverVersion);
+                    if (!BrowserStore.getLastServerVersion()) {
+                        BrowserStore.setLastServerVersion(serverVersion);
                     }
 
-                    if (serverVersion !== UserStore.getLastVersion()) {
-                        UserStore.setLastVersion(serverVersion);
+                    if (serverVersion !== BrowserStore.getLastServerVersion()) {
+                        BrowserStore.setLastServerVersion(serverVersion);
                         window.location.href = window.location.href;
                         console.log('Detected version update refreshing the page'); //eslint-disable-line no-console
                     }
@@ -77,7 +78,7 @@ export function getChannels(force, updateLastViewed, checkVersion) {
                     members: data.members
                 });
             },
-            function getChannelsFailure(err) {
+            (err) => {
                 callTracker.getChannels = 0;
                 dispatchError(err, 'getChannels');
             }
@@ -566,8 +567,8 @@ export function getMe() {
     }
 
     callTracker.getMe = utils.getTimestamp();
-    client.getMeSynchronous(
-        function getMeSyncSuccess(data, textStatus, xhr) {
+    client.getMe(
+        (data, textStatus, xhr) => {
             callTracker.getMe = 0;
 
             if (xhr.status === 304 || !data) {
@@ -579,7 +580,7 @@ export function getMe() {
                 me: data
             });
         },
-        function getMeSyncFailure(err) {
+        (err) => {
             callTracker.getMe = 0;
             dispatchError(err, 'getMe');
         }
-- 
cgit v1.2.3-1-g7c22

