bigbuffet-rw/app/soapbox/reducers/meta.ts

21 lines
469 B
TypeScript
Raw Normal View History

2020-03-27 13:59:38 -07:00
'use strict';
import { Record as ImmutableRecord } from 'immutable';
2022-01-10 14:01:24 -08:00
import { INSTANCE_FETCH_FAIL } from 'soapbox/actions/instance';
2020-03-27 13:59:38 -07:00
2022-04-24 12:28:07 -07:00
import type { AnyAction } from 'redux';
const ReducerRecord = ImmutableRecord({
instance_fetch_failed: false,
});
2020-03-27 13:59:38 -07:00
2022-04-24 12:28:07 -07:00
export default function meta(state = ReducerRecord(), action: AnyAction) {
2020-03-27 13:59:38 -07:00
switch(action.type) {
case INSTANCE_FETCH_FAIL:
return state.set('instance_fetch_failed', true);
2020-03-27 13:59:38 -07:00
default:
return state;
}
2021-08-03 12:22:51 -07:00
}