kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
corrected errors
rodzic
b337a4560e
commit
181eef1edd
|
@ -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,
|
||||
|
|
|
@ -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:
|
||||
|
|
Ładowanie…
Reference in New Issue