mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-12-05 07:49:03 +01:00
3e9298370d
Port 2c5ab8f647
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
23 lines
782 B
JavaScript
23 lines
782 B
JavaScript
import { Map as ImmutableMap } from 'immutable';
|
|
|
|
import { changeLayout } from 'flavours/glitch/actions/app';
|
|
import { STORE_HYDRATE } from 'flavours/glitch/actions/store';
|
|
import { layoutFromWindow } from 'flavours/glitch/is_mobile';
|
|
|
|
const initialState = ImmutableMap({
|
|
streaming_api_base_url: null,
|
|
layout: layoutFromWindow(),
|
|
permissions: '0',
|
|
});
|
|
|
|
export default function meta(state = initialState, action) {
|
|
switch(action.type) {
|
|
case STORE_HYDRATE:
|
|
// we do not want `access_token` to be stored in the state
|
|
return state.merge(action.state.get('meta')).delete('access_token').set('permissions', action.state.getIn(['role', 'permissions']));
|
|
case changeLayout.type:
|
|
return state.set('layout', action.payload.layout);
|
|
default:
|
|
return state;
|
|
}
|
|
}
|