summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/actions')
-rw-r--r--webapp/actions/user_actions.jsx17
1 files changed, 7 insertions, 10 deletions
diff --git a/webapp/actions/user_actions.jsx b/webapp/actions/user_actions.jsx
index 015c933bf..8814d5286 100644
--- a/webapp/actions/user_actions.jsx
+++ b/webapp/actions/user_actions.jsx
@@ -383,21 +383,18 @@ export function loadProfilesForDM() {
}
}
-export function saveTheme(teamId, theme, onSuccess, onError) {
+export function saveTheme(teamId, theme, cb) {
const currentUserId = UserStore.getCurrentId();
- savePreferences(currentUserId, [{
+ const preference = [{
user_id: currentUserId,
category: Preferences.CATEGORY_THEME,
name: teamId,
value: JSON.stringify(theme)
- }])(dispatch, getState).then(
- (data) => {
- if (data && onSuccess) {
- onThemeSaved(teamId, theme, onSuccess);
- } else if (data == null && onError) {
- const serverError = getState().requests.users.savePreferences.error;
- onError({id: serverError.server_error_id, ...serverError});
- }
+ }];
+
+ savePreferences(currentUserId, preference)(dispatch, getState).then(
+ () => {
+ onThemeSaved(teamId, theme, cb);
}
);
}