summaryrefslogtreecommitdiffstats
path: root/web/react/stores/preference_store.jsx
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-10-02 14:25:55 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-10-13 09:42:24 -0400
commited31538893ad2790de46ace7eeac5c1aa015a7f1 (patch)
tree3db603d322390b4d534501dd46932f96ef279ce3 /web/react/stores/preference_store.jsx
parent7d03c24b44a2f4eba86adf86954280fa73e726e4 (diff)
downloadchat-ed31538893ad2790de46ace7eeac5c1aa015a7f1.tar.gz
chat-ed31538893ad2790de46ace7eeac5c1aa015a7f1.tar.bz2
chat-ed31538893ad2790de46ace7eeac5c1aa015a7f1.zip
Changed direct messages channels so users can show/hide them
Diffstat (limited to 'web/react/stores/preference_store.jsx')
-rw-r--r--web/react/stores/preference_store.jsx9
1 files changed, 4 insertions, 5 deletions
diff --git a/web/react/stores/preference_store.jsx b/web/react/stores/preference_store.jsx
index c13c61e1d..d731e7d27 100644
--- a/web/react/stores/preference_store.jsx
+++ b/web/react/stores/preference_store.jsx
@@ -75,13 +75,13 @@ class PreferenceStoreClass extends EventEmitter {
}
setPreference(category, name, value) {
- this.setPreferenceWithAltId(category, name, '', value);
+ return this.setPreferenceWithAltId(category, name, '', value);
}
setPreferenceWithAltId(category, name, altId, value) {
const preferences = this.getAllPreferences();
- const key = this.getKey(category, name);
+ const key = this.getKey(category, name, altId);
let preference = preferences.get(key);
if (!preference) {
@@ -97,6 +97,8 @@ class PreferenceStoreClass extends EventEmitter {
preferences.set(key, preference);
this.setAllPreferences(preferences);
+
+ return preference;
}
emitChange(preferences) {
@@ -130,6 +132,3 @@ class PreferenceStoreClass extends EventEmitter {
const PreferenceStore = new PreferenceStoreClass();
export default PreferenceStore;
-
-// TODO remove me
-global.PreferenceStore = PreferenceStore;