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
1 changed files with 6 additions and 1 deletions

View File

@ -1,7 +1,8 @@
'use strict'; 'use strict';
import { STORE_HYDRATE } from '../actions/store'; 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({ const initialState = ImmutableMap({
streaming_api_base_url: null, streaming_api_base_url: null,
@ -12,6 +13,10 @@ export default function meta(state = initialState, action) {
switch(action.type) { switch(action.type) {
case STORE_HYDRATE: case STORE_HYDRATE:
return state.merge(action.state.get('meta')); 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: default:
return state; return state;
} }