diff options
Diffstat (limited to 'webapp/utils/async_client.jsx')
-rw-r--r-- | webapp/utils/async_client.jsx | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx index 712d447e8..deb967e3a 100644 --- a/webapp/utils/async_client.jsx +++ b/webapp/utils/async_client.jsx @@ -1,7 +1,6 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import BrowserStore from 'stores/browser_store.jsx'; import UserStore from 'stores/user_store.jsx'; import TeamStore from 'stores/team_store.jsx'; @@ -21,6 +20,12 @@ const callTracker = {}; const ASYNC_CLIENT_TIMEOUT = 5000; +// Redux actions +import store from 'stores/redux_store.jsx'; +const dispatch = store.dispatch; +const getState = store.getState; +import {setServerVersion} from 'mattermost-redux/actions/general'; + export function dispatchError(err, method) { AppDispatcher.handleServerAction({ type: ActionTypes.RECEIVED_ERROR, @@ -47,17 +52,7 @@ function isCallInProgress(callName) { } export function checkVersion() { - var serverVersion = Client.getServerVersion(); - - if (serverVersion !== BrowserStore.getLastServerVersion()) { - if (!BrowserStore.getLastServerVersion() || BrowserStore.getLastServerVersion() === '') { - BrowserStore.setLastServerVersion(serverVersion); - } else { - BrowserStore.setLastServerVersion(serverVersion); - window.location.reload(true); - console.log('Detected version update refreshing the page'); //eslint-disable-line no-console - } - } + setServerVersion(Client.getServerVersion())(dispatch, getState); } export function getUser(userId, success, error) { |