]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(settings): Show proper warning if app discover section could not be fetched
authorFerdinand Thiessen <opensource@fthiessen.de>
Mon, 18 Mar 2024 18:07:12 +0000 (19:07 +0100)
committerFerdinand Thiessen <opensource@fthiessen.de>
Tue, 19 Mar 2024 18:42:34 +0000 (19:42 +0100)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
apps/settings/src/components/AppStoreDiscover/AppStoreDiscoverSection.vue

index 4072af9f719bdd0a6937a9c78939ea9c8862c31f..5c167c22abd6dda7fb4969c9d7d480388eaac7f7 100644 (file)
@@ -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