aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/src
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-03-18 19:07:12 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2024-03-19 19:42:34 +0100
commitc0a9b59d2695cf47cb0d4f92e2a153aa8d7fbdc0 (patch)
tree62314a11ff68eb53e8177ff1dbabc035058fceaa /apps/settings/src
parentc69d1c581c363333d7914a53c2125da695778f57 (diff)
downloadnextcloud-server-c0a9b59d2695cf47cb0d4f92e2a153aa8d7fbdc0.tar.gz
nextcloud-server-c0a9b59d2695cf47cb0d4f92e2a153aa8d7fbdc0.zip
fix(settings): Show proper warning if app discover section could not be fetched
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/settings/src')
-rw-r--r--apps/settings/src/components/AppStoreDiscover/AppStoreDiscoverSection.vue5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/settings/src/components/AppStoreDiscover/AppStoreDiscoverSection.vue b/apps/settings/src/components/AppStoreDiscover/AppStoreDiscoverSection.vue
index 4072af9f719..5c167c22abd 100644
--- a/apps/settings/src/components/AppStoreDiscover/AppStoreDiscoverSection.vue
+++ b/apps/settings/src/components/AppStoreDiscover/AppStoreDiscoverSection.vue
@@ -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