From 5f7863f130c0986ed07f529603b888003f58b7d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 26 Oct 2024 20:07:54 +0200 Subject: [PATCH] pl-fe: remove obsolete workaround MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/src/actions/statuses.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/pl-fe/src/actions/statuses.ts b/packages/pl-fe/src/actions/statuses.ts index 54fca4893..652771269 100644 --- a/packages/pl-fe/src/actions/statuses.ts +++ b/packages/pl-fe/src/actions/statuses.ts @@ -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) {