summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/async_client.jsx17
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,