summaryrefslogtreecommitdiffstats
path: root/web/react/utils/async_client.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-17 21:00:59 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-17 21:00:59 -0700
commit44714dfcb18b9a393dc34be3c182b0c092eec28a (patch)
tree117bc8a3bc37f9112abf5498248c779081df514f /web/react/utils/async_client.jsx
parent82127341cacd4299f9a59e76b5f68d6d7222c45b (diff)
downloadchat-44714dfcb18b9a393dc34be3c182b0c092eec28a.tar.gz
chat-44714dfcb18b9a393dc34be3c182b0c092eec28a.tar.bz2
chat-44714dfcb18b9a393dc34be3c182b0c092eec28a.zip
PLT-11 Adding ability to save config file
Diffstat (limited to 'web/react/utils/async_client.jsx')
-rw-r--r--web/react/utils/async_client.jsx26
1 files changed, 26 insertions, 0 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index 3e23e5c33..ed228f6c4 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -345,6 +345,32 @@ export function getLogs() {
);
}
+export function getConfig() {
+ if (isCallInProgress('getConfig')) {
+ return;
+ }
+
+ callTracker.getConfig = utils.getTimestamp();
+ client.getConfig(
+ (data, textStatus, xhr) => {
+ callTracker.getConfig = 0;
+
+ if (xhr.status === 304 || !data) {
+ return;
+ }
+
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECIEVED_CONFIG,
+ config: data
+ });
+ },
+ (err) => {
+ callTracker.getConfig = 0;
+ dispatchError(err, 'getConfig');
+ }
+ );
+}
+
export function findTeams(email) {
if (isCallInProgress('findTeams_' + email)) {
return;