diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-10-13 11:52:17 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-10-13 12:29:31 -0400 |
commit | 2a39e8dbfab8506b09d0d030f87cac4c079b975a (patch) | |
tree | dd2ca36ca7ef73a2cf8eda11d6a62848d7d29a79 /web/react/stores/preference_store.jsx | |
parent | 5cecf1afcd1d8e561a5b2d840e5bd1b588a74a27 (diff) | |
download | chat-2a39e8dbfab8506b09d0d030f87cac4c079b975a.tar.gz chat-2a39e8dbfab8506b09d0d030f87cac4c079b975a.tar.bz2 chat-2a39e8dbfab8506b09d0d030f87cac4c079b975a.zip |
Removed Preference.AltId
Diffstat (limited to 'web/react/stores/preference_store.jsx')
-rw-r--r-- | web/react/stores/preference_store.jsx | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/web/react/stores/preference_store.jsx b/web/react/stores/preference_store.jsx index 8101452ed..4d7fb9ad6 100644 --- a/web/react/stores/preference_store.jsx +++ b/web/react/stores/preference_store.jsx @@ -15,12 +15,10 @@ class PreferenceStoreClass extends EventEmitter { this.getAllPreferences = this.getAllPreferences.bind(this); this.getPreference = this.getPreference.bind(this); - this.getPreferenceWithAltId = this.getPreferenceWithAltId.bind(this); this.getPreferences = this.getPreferences.bind(this); this.getPreferencesWhere = this.getPreferencesWhere.bind(this); this.setAllPreferences = this.setAllPreferences.bind(this); this.setPreference = this.setPreference.bind(this); - this.setPreferenceWithAltId = this.setPreferenceWithAltId.bind(this); this.emitChange = this.emitChange.bind(this); this.addChangeListener = this.addChangeListener.bind(this); @@ -30,12 +28,12 @@ class PreferenceStoreClass extends EventEmitter { this.dispatchToken = AppDispatcher.register(this.handleEventPayload); } - getKey(category, name, altId = '') { - return `${category}-${name}-${altId}`; + getKey(category, name) { + return `${category}-${name}`; } getKeyForModel(preference) { - return `${preference.category}-${preference.name}-${preference.alt_id}`; + return `${preference.category}-${preference.name}`; } getAllPreferences() { @@ -46,12 +44,8 @@ class PreferenceStoreClass extends EventEmitter { return this.getAllPreferences().get(this.getKey(category, name)) || defaultValue; } - getPreferenceWithAltId(category, name, altId, defaultValue = '') { - return this.getAllPreferences().get(this.getKey(category, name, altId)) || defaultValue; - } - - getPreferences(category, name) { - return this.getPreferencesWhere((preference) => (preference.category === category && preference.name === name)); + getPreferences(category) { + return this.getPreferencesWhere((preference) => (preference.category === category)); } getPreferencesWhere(pred) { @@ -74,21 +68,16 @@ class PreferenceStoreClass extends EventEmitter { } setPreference(category, name, value) { - return this.setPreferenceWithAltId(category, name, '', value); - } - - setPreferenceWithAltId(category, name, altId, value) { const preferences = this.getAllPreferences(); - const key = this.getKey(category, name, altId); + const key = this.getKey(category, name); let preference = preferences.get(key); if (!preference) { preference = { user_id: UserStore.getCurrentId(), category, - name, - alt_id: altId + name }; } preference.value = value; |