Pull Pleroma meta from verify_credentials into Redux store
This commit is contained in:
parent
24810f83c0
commit
5fdcd80ceb
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue