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) {
|
export function importSoapboxConfig(soapboxConfig) {
|
||||||
if(soapboxConfig.get('brandColor') === '') {
|
if (!soapboxConfig.brandColor) {
|
||||||
const defaultBrandColor = ImmutableMap({
|
soapboxConfig.brandColor = '#0482d8';
|
||||||
brandColor: '#0482d8', // Azure
|
|
||||||
});
|
|
||||||
defaultBrandColor.mergeDeep(soapboxConfig);
|
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
type: SOAPBOX_CONFIG_REQUEST_SUCCESS,
|
type: SOAPBOX_CONFIG_REQUEST_SUCCESS,
|
||||||
|
|
|
@ -8,6 +8,10 @@ import { ConfigDB } from 'soapbox/utils/config_db';
|
||||||
|
|
||||||
const initialState = ImmutableMap();
|
const initialState = ImmutableMap();
|
||||||
|
|
||||||
|
const fallbackState = ImmutableMap({
|
||||||
|
brandColor: '#0482d8', // Azure
|
||||||
|
});
|
||||||
|
|
||||||
const updateFromAdmin = (state, config) => {
|
const updateFromAdmin = (state, config) => {
|
||||||
const configs = config.get('configs', ImmutableList());
|
const configs = config.get('configs', ImmutableList());
|
||||||
|
|
||||||
|
@ -26,10 +30,7 @@ export default function soapbox(state = initialState, action) {
|
||||||
case SOAPBOX_CONFIG_REQUEST_SUCCESS:
|
case SOAPBOX_CONFIG_REQUEST_SUCCESS:
|
||||||
return fromJS(action.soapboxConfig);
|
return fromJS(action.soapboxConfig);
|
||||||
case SOAPBOX_CONFIG_REQUEST_FAIL:
|
case SOAPBOX_CONFIG_REQUEST_FAIL:
|
||||||
const defaultBrandColor = ImmutableMap({
|
return fallbackState.mergeDeep(state.get('soapbox'));
|
||||||
brandColor: '#0482d8', // Azure
|
|
||||||
});
|
|
||||||
return defaultBrandColor.mergeDeep(state.get('soapbox'));
|
|
||||||
case ADMIN_CONFIG_UPDATE_SUCCESS:
|
case ADMIN_CONFIG_UPDATE_SUCCESS:
|
||||||
return updateFromAdmin(state, fromJS(action.config));
|
return updateFromAdmin(state, fromJS(action.config));
|
||||||
default:
|
default:
|
||||||
|
|
Ładowanie…
Reference in New Issue