diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-03-23 14:22:30 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-03-23 14:22:30 -0400 |
commit | 6275ad2ae48807738ddd9a28bd69ff3f5ccc1a50 (patch) | |
tree | adee85d0a0e2e09f846fd4890c6b5843728ca165 /webapp/utils/async_client.jsx | |
parent | aed690c5891a2cff97cc5fa00648c86be54ed8ee (diff) | |
parent | 1f46cca65ca0669c1fc1a6fec5113f835a1a3023 (diff) | |
download | chat-6275ad2ae48807738ddd9a28bd69ff3f5ccc1a50.tar.gz chat-6275ad2ae48807738ddd9a28bd69ff3f5ccc1a50.tar.bz2 chat-6275ad2ae48807738ddd9a28bd69ff3f5ccc1a50.zip |
Merge pull request #2515 from hmhealey/prefs
Changed PreferenceStore to store data in memory
Diffstat (limited to 'webapp/utils/async_client.jsx')
-rw-r--r-- | webapp/utils/async_client.jsx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx index d3f91bb0e..6140fd9e0 100644 --- a/webapp/utils/async_client.jsx +++ b/webapp/utils/async_client.jsx @@ -673,9 +673,9 @@ export function getStatuses() { const preferences = PreferenceStore.getCategory(Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW); const teammateIds = []; - for (const preference of preferences) { - if (preference.value === 'true') { - teammateIds.push(preference.name); + for (const [name, value] of preferences) { + if (value === 'true') { + teammateIds.push(name); } } @@ -756,6 +756,17 @@ export function getAllPreferences() { ); } +export function savePreference(category, name, value, success, error) { + const preference = { + user_id: UserStore.getCurrentId(), + category, + name, + value + }; + + savePreferences([preference], success, error); +} + export function savePreferences(preferences, success, error) { client.savePreferences( preferences, |