Merge branch 'fe-config-fix' into 'develop'

Fix Soapbox Config

Closes #864

See merge request soapbox-pub/soapbox-fe!1120
This commit is contained in:
Alex Gleason 2022-03-20 23:54:59 +00:00
commit 83a49e7d35
3 changed files with 3122 additions and 2 deletions

File diff suppressed because it is too large Load diff

View file

@ -52,7 +52,7 @@ const getConfigValue = (instanceConfig: ImmutableMap<string, any>, key: string)
return v ? v.getIn(['tuple', 1]) : undefined;
};
const importConfigs = (state: typeof initialState, configs: ImmutableMap<string, any>) => {
const importConfigs = (state: typeof initialState, configs: ImmutableList<any>) => {
// FIXME: This is pretty hacked together. Need to make a cleaner map.
const config = ConfigDB.find(configs, ':pleroma', ':instance');
const simplePolicy = ConfigDB.toSimplePolicy(configs);
@ -126,7 +126,7 @@ export default function instance(state = initialState, action: AnyAction) {
return importNodeinfo(state, ImmutableMap(fromJS(action.nodeinfo)));
case ADMIN_CONFIG_UPDATE_REQUEST:
case ADMIN_CONFIG_UPDATE_SUCCESS:
return importConfigs(state, ImmutableMap(fromJS(action.configs)));
return importConfigs(state, ImmutableList(fromJS(action.configs)));
default:
return state;
}