diff --git a/app/soapbox/actions/soapbox.js b/app/soapbox/actions/soapbox.js index f975bf848..e6cced78b 100644 --- a/app/soapbox/actions/soapbox.js +++ b/app/soapbox/actions/soapbox.js @@ -48,12 +48,9 @@ export function fetchSoapboxJson() { }; } -export function importSoapboxConfig(soapboxConfig, getIn) { - if(soapboxConfig.get('brandColor') === '') { - const defaultBrandColor = ImmutableMap({ - brandColor: '#0482d8', // Azure - }); - defaultBrandColor.mergeDeep(soapboxConfig); +export function importSoapboxConfig(soapboxConfig) { + if (!soapboxConfig.brandColor) { + soapboxConfig.brandColor = '#0482d8'; }; return { type: SOAPBOX_CONFIG_REQUEST_SUCCESS, diff --git a/app/soapbox/reducers/soapbox.js b/app/soapbox/reducers/soapbox.js index c58b22ddb..3e448add2 100644 --- a/app/soapbox/reducers/soapbox.js +++ b/app/soapbox/reducers/soapbox.js @@ -8,6 +8,10 @@ import { ConfigDB } from 'soapbox/utils/config_db'; const initialState = ImmutableMap(); +const fallbackState = ImmutableMap({ + brandColor: '#0482d8', // Azure +}); + const updateFromAdmin = (state, config) => { const configs = config.get('configs', ImmutableList()); @@ -26,10 +30,7 @@ export default function soapbox(state = initialState, action) { case SOAPBOX_CONFIG_REQUEST_SUCCESS: return fromJS(action.soapboxConfig); case SOAPBOX_CONFIG_REQUEST_FAIL: - const defaultBrandColor = ImmutableMap({ - brandColor: '#0482d8', // Azure - }); - return defaultBrandColor.mergeDeep(state.get('soapbox')); + return fallbackState.mergeDeep(state.get('soapbox')); case ADMIN_CONFIG_UPDATE_SUCCESS: return updateFromAdmin(state, fromJS(action.config)); default: