Don't error out if we can't fetch reports

This commit is contained in:
FloatingGhost 2022-11-21 17:08:53 +00:00 committed by hynet-mel
parent c3f829eb68
commit 64cb7443a8

View file

@ -650,7 +650,7 @@ const getReports = ({ state, limit, page, pageSize, credentials }) => {
url = url + (args ? '?' + args : '') url = url + (args ? '?' + args : '')
return fetch(url, { headers: authHeaders(credentials) }) return fetch(url, { headers: authHeaders(credentials) })
.then((data) => data.json()) .then((data) => data.json())
.then((data) => data.reports.map(parseReport)) .then((data) => data?.reports?.map(parseReport) ?? [])
} }
const updateReportStates = ({ credentials, reports }) => { const updateReportStates = ({ credentials, reports }) => {