bigbuffet-rw/app/gabsocial/reducers/instance.js

23 lines
568 B
JavaScript
Raw Normal View History

2020-04-01 13:05:52 -07:00
import { INSTANCE_IMPORT } from '../actions/instance';
import { Map as ImmutableMap, fromJS } from 'immutable';
2020-04-15 11:20:09 -07:00
// Set Mastodon defaults, overridden by Pleroma servers
const initialState = ImmutableMap({
max_toot_chars: 500,
poll_limits: ImmutableMap({
max_expiration: 2629746,
max_option_chars: 25,
max_options: 4,
min_expiration: 300,
}),
});
2020-04-01 13:05:52 -07:00
export default function instance(state = initialState, action) {
switch(action.type) {
case INSTANCE_IMPORT:
return ImmutableMap(fromJS(action.instance));
default:
return state;
}
};