Pull Pleroma meta from verify_credentials into Redux store
This commit is contained in:
parent
24810f83c0
commit
5fdcd80ceb
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue