pleroma/app/soapbox/reducers/meta.ts
2022-04-25 15:47:47 -05:00

20 lines
471 B
TypeScript

'use strict';
import { Record as ImmutableRecord } from 'immutable';
import { fetchInstance } from 'soapbox/actions/instance';
import type { AnyAction } from 'redux';
const ReducerRecord = ImmutableRecord({
instance_fetch_failed: false,
});
export default function meta(state = ReducerRecord(), action: AnyAction) {
switch(action.type) {
case fetchInstance.rejected.type:
return state.set('instance_fetch_failed', true);
default:
return state;
}
}