diff --git a/app/soapbox/containers/soapbox.js b/app/soapbox/containers/soapbox.js index 5c42d5a13..7c196252a 100644 --- a/app/soapbox/containers/soapbox.js +++ b/app/soapbox/containers/soapbox.js @@ -48,7 +48,7 @@ const mapStateToProps = (state) => { dyslexicFont: settings.get('dyslexicFont'), demetricator: settings.get('demetricator'), locale: settings.get('locale'), - themeCss: generateThemeCss(state.getIn(['soapbox', 'brandColor'], '#0482d8')), // Azure default + themeCss: generateThemeCss(state.getIn(['soapbox', 'brandColor'])), themeMode: settings.get('themeMode'), }; }; diff --git a/app/soapbox/reducers/soapbox.js b/app/soapbox/reducers/soapbox.js index b2600f81e..147bd6c49 100644 --- a/app/soapbox/reducers/soapbox.js +++ b/app/soapbox/reducers/soapbox.js @@ -1,12 +1,21 @@ -import { SOAPBOX_CONFIG_REQUEST_SUCCESS } from '../actions/soapbox'; +import { + SOAPBOX_CONFIG_REQUEST_SUCCESS, + SOAPBOX_CONFIG_REQUEST_FAIL, +} from '../actions/soapbox'; import { Map as ImmutableMap, fromJS } from 'immutable'; const initialState = ImmutableMap(); +const defaultState = ImmutableMap({ + brandColor: '#0482d8', // Azure +}); + export default function soapbox(state = initialState, action) { switch(action.type) { case SOAPBOX_CONFIG_REQUEST_SUCCESS: - return ImmutableMap(fromJS(action.soapboxConfig)); + return defaultState.merge(ImmutableMap(fromJS(action.soapboxConfig))); + case SOAPBOX_CONFIG_REQUEST_FAIL: + return defaultState; default: return state; }