temporary hotfix for live api resp handling
This commit is contained in:
parent
3040b9ea12
commit
8887996718
1 changed files with 8 additions and 3 deletions
|
@ -57,9 +57,13 @@ const fetchLiveChannels = async () => {
|
|||
|
||||
const fetchLiveChannel = async (channelId: string) => {
|
||||
const response = await fetch(`${LIVESTREAM_LIVE_API}/${channelId}`);
|
||||
const json = await response.json();
|
||||
if (!(json.data && json.data.live)) throw new Error();
|
||||
return transformLivestreamData([json.data]);
|
||||
try {
|
||||
const json = await response.json();
|
||||
if (!(json.data && json.data.live)) throw new Error();
|
||||
return transformLivestreamData([json.data]);
|
||||
} catch {
|
||||
throw new Error('Error handling live API response');
|
||||
}
|
||||
};
|
||||
|
||||
const filterUpcomingLiveStreamClaims = (upcomingClaims) => {
|
||||
|
@ -176,6 +180,7 @@ export const doFetchActiveLivestream = (channelId: string) => {
|
|||
},
|
||||
});
|
||||
} catch (err) {
|
||||
if (err.message === 'Error handling live API response') return;
|
||||
dispatch({ type: ACTIONS.FETCH_ACTIVE_LIVESTREAM_FAILED, data: { channelId } });
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue