summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-08-14 08:48:24 -0400
committerChristopher Speller <crspeller@gmail.com>2015-08-14 08:48:24 -0400
commit92c4df5b109ac8b15f6384a5c027024696bbd4d8 (patch)
tree41a18a9bcbbcc7cd961cc424878ac37aade5c288 /web/react/utils
parenta8930cbabec21635a10e8cac4d2c0c79867f283d (diff)
parent8fc4456213c5ee16863b7f1bcb20e35a19469a1d (diff)
downloadchat-92c4df5b109ac8b15f6384a5c027024696bbd4d8.tar.gz
chat-92c4df5b109ac8b15f6384a5c027024696bbd4d8.tar.bz2
chat-92c4df5b109ac8b15f6384a5c027024696bbd4d8.zip
Merge pull request #370 from hmhealey/mm1812
MM-1812 Provide warnings on team invite screens when email is disabled
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/async_client.jsx26
-rw-r--r--web/react/utils/client.jsx15
-rw-r--r--web/react/utils/constants.jsx2
3 files changed, 43 insertions, 0 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index 7e8a6116c..0b87bbd7b 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -4,6 +4,7 @@
var client = require('./client.jsx');
var AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
var ChannelStore = require('../stores/channel_store.jsx');
+var ConfigStore = require('../stores/config_store.jsx');
var PostStore = require('../stores/post_store.jsx');
var UserStore = require('../stores/user_store.jsx');
var utils = require('./utils.jsx');
@@ -457,3 +458,28 @@ module.exports.getMyTeam = function() {
}
);
}
+
+function getConfig() {
+ if (isCallInProgress('getConfig')) {
+ return;
+ }
+
+ callTracker['getConfig'] = utils.getTimestamp();
+ client.getConfig(
+ function(data, textStatus, xhr) {
+ callTracker['getConfig'] = 0;
+
+ if (data && xhr.status !== 304) {
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECIEVED_CONFIG,
+ settings: data
+ });
+ }
+ },
+ function(err) {
+ callTracker['getConfig'] = 0;
+ dispatchError(err, 'getConfig');
+ }
+ );
+}
+module.exports.getConfig = getConfig;
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index f2b6619a5..5aab80d01 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -880,3 +880,18 @@ module.exports.updateValetFeature = function(data, success, error) {
module.exports.track('api', 'api_teams_update_valet_feature');
};
+
+function getConfig(success, error) {
+ $.ajax({
+ url: '/api/v1/config/get_all',
+ dataType: 'json',
+ type: 'GET',
+ ifModified: true,
+ success: success,
+ error: function(xhr, status, err) {
+ var e = handleError('getConfig', xhr, status, err);
+ error(e);
+ }
+ });
+};
+module.exports.getConfig = getConfig;
diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx
index 0c714567a..508de9185 100644
--- a/web/react/utils/constants.jsx
+++ b/web/react/utils/constants.jsx
@@ -31,6 +31,8 @@ module.exports = {
CLICK_TEAM: null,
RECIEVED_TEAM: null,
+
+ RECIEVED_CONFIG: null
}),
PayloadSources: keyMirror({