diff options
Diffstat (limited to 'web/react/stores/preference_store.jsx')
-rw-r--r-- | web/react/stores/preference_store.jsx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/web/react/stores/preference_store.jsx b/web/react/stores/preference_store.jsx index 068bc29c2..e6a1d8a2b 100644 --- a/web/react/stores/preference_store.jsx +++ b/web/react/stores/preference_store.jsx @@ -90,8 +90,8 @@ class PreferenceStoreClass extends EventEmitter { return preference; } - emitChange(preferences) { - this.emit(CHANGE_EVENT, preferences); + emitChange() { + this.emit(CHANGE_EVENT); } addChangeListener(callback) { @@ -106,6 +106,12 @@ class PreferenceStoreClass extends EventEmitter { const action = payload.action; switch (action.type) { + case ActionTypes.RECIEVED_PREFERENCE: { + const preference = action.preference; + this.setPreference(preference.category, preference.name, preference.value); + this.emitChange(); + break; + } case ActionTypes.RECIEVED_PREFERENCES: { const preferences = this.getAllPreferences(); @@ -114,7 +120,7 @@ class PreferenceStoreClass extends EventEmitter { } this.setAllPreferences(preferences); - this.emitChange(preferences); + this.emitChange(); break; } } |