Pull Pleroma meta from verify_credentials into Redux store

This commit is contained in:
Alex Gleason 2020-04-17 16:13:08 -05:00
parent 24810f83c0
commit 5fdcd80ceb
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -1,7 +1,8 @@
'use strict';
import { STORE_HYDRATE } from '../actions/store';
import { Map as ImmutableMap } from 'immutable';
import { ME_FETCH_SUCCESS } from 'gabsocial/actions/me';
import { Map as ImmutableMap, fromJS } from 'immutable';
const initialState = ImmutableMap({
streaming_api_base_url: null,
@ -12,6 +13,10 @@ export default function meta(state = initialState, action) {
switch(action.type) {
case STORE_HYDRATE:
return state.merge(action.state.get('meta'));
case ME_FETCH_SUCCESS:
const me = fromJS(action.me);
const pleroPrefs = me.get('pleroma').delete('settings_store');
return state.set('pleroma', pleroPrefs);
default:
return state;
}