mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
fix(settings): Show proper warning if app discover section could not be fetched
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
c69d1c581c
commit
c0a9b59d26
1 changed files with 5 additions and 0 deletions
|
|
@ -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…
Reference in a new issue