From 86211d3ca6131ed28a7619ae98dea07f5653f9f9 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 14 Jun 2017 23:07:06 +0200 Subject: [PATCH] Fix regression from #3748 - properly set defaultColumns (#3750) --- app/javascript/mastodon/reducers/settings.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/javascript/mastodon/reducers/settings.js b/app/javascript/mastodon/reducers/settings.js index 35698ef82e..ddad7a4fc2 100644 --- a/app/javascript/mastodon/reducers/settings.js +++ b/app/javascript/mastodon/reducers/settings.js @@ -60,12 +60,7 @@ const defaultColumns = Immutable.fromJS([ { id: 'NOTIFICATIONS', uuid: uuid(), params: {} }, ]); -const hydrate = (settings) => { - return initialState.withMutations((state) => { - state.mergeDeep(settings); - state.update('columns', defaultColumns, val => val); - }); -}; +const hydrate = (state, settings) => state.mergeDeep(settings).update('columns', (val = defaultColumns) => val); const moveColumn = (state, uuid, direction) => { const columns = state.get('columns'); @@ -83,7 +78,7 @@ const moveColumn = (state, uuid, direction) => { export default function settings(state = initialState, action) { switch(action.type) { case STORE_HYDRATE: - return hydrate(action.state.get('settings')); + return hydrate(state, action.state.get('settings')); case SETTING_CHANGE: return state.setIn(action.key, action.value); case COLUMN_ADD: