fix(settings): Show proper warning if app discover section could not be fetched

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/44286/head
Ferdinand Thiessen 2 months ago
parent c69d1c581c
commit c0a9b59d26
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400

@ -64,6 +64,11 @@ const shuffleArray = <T, >(array: T[]): T[] => {
onBeforeMount(async () => {
try {
const { data } = await axios.get<Record<string, unknown>[]>(generateUrl('/settings/api/apps/discover'))
if (data.length === 0) {
logger.info('No app discover elements available (empty response)')
hasError.value = true
return
}
// Parse data to ensure dates are useable and then filter out expired or future elements
const parsedElements = data.map(parseApiResponse).filter(filterElements)
// Shuffle elements to make it looks more interesting

Loading…
Cancel
Save