pl-fe: remove obsolete workaround

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-10-26 20:07:54 +02:00
parent 5691837235
commit 5f7863f130

View file

@ -164,14 +164,10 @@ const fetchContext = (statusId: string, intl?: IntlShape) =>
} : undefined;
return getClient(getState()).statuses.getContext(statusId, params).then(context => {
if (typeof context === 'object') {
const { ancestors, descendants } = context;
const statuses = ancestors.concat(descendants);
dispatch(importFetchedStatuses(statuses));
dispatch({ type: CONTEXT_FETCH_SUCCESS, statusId, ancestors, descendants });
} else {
throw context;
}
const { ancestors, descendants } = context;
const statuses = ancestors.concat(descendants);
dispatch(importFetchedStatuses(statuses));
dispatch({ type: CONTEXT_FETCH_SUCCESS, statusId, ancestors, descendants });
return context;
}).catch(error => {
if (error.response?.status === 404) {