From 83474dec83c35c805eb81b83aed77cada5b9f8ec Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 24 Jun 2026 22:16:58 +0200 Subject: [PATCH] fix(appstore): use proper app icon or adjust color if needed - resolves https://github.com/nextcloud/server/issues/61244 Use the dark variant if possible first and then fallback to bright variant and adjust the icon if needed. Signed-off-by: Ferdinand Thiessen --- apps/appstore/img/app-dark.svg | 2 +- apps/appstore/src/components/AppIcon.vue | 4 ++++ lib/private/legacy/OC_App.php | 19 +++---------------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/apps/appstore/img/app-dark.svg b/apps/appstore/img/app-dark.svg index ded70d96295f9..066a066f2bdff 100644 --- a/apps/appstore/img/app-dark.svg +++ b/apps/appstore/img/app-dark.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/apps/appstore/src/components/AppIcon.vue b/apps/appstore/src/components/AppIcon.vue index d6415c0057720..8f4dbb9bbe438 100644 --- a/apps/appstore/src/components/AppIcon.vue +++ b/apps/appstore/src/components/AppIcon.vue @@ -24,6 +24,10 @@ watch(() => app.icon, async () => { const response = await fetch(app.icon) if (response.ok) { svgIcon.value = await response.text() + svgIcon.value = svgIcon.value + .replaceAll(/(?<=[";])fill:\s?(#fff(fff)?|white)(;|(?="))/gi, '') + .replaceAll(/(?<=\s)fill="[^"]+"/gi, '') + .replaceAll(/(?<=\s)color="[^"]+"/gi, '') } } }, { immediate: true }) diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index d240b996bcf77..13e4359fce834 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -445,22 +445,9 @@ public function listAllApps(): array { $info['level'] = self::supportedApp; } - try { - $appPath = $appManager->getAppPath($app); - } catch (AppPathNotFoundException) { - $appPath = false; - } - if ($appPath !== false) { - $appIcon = $appPath . '/img/' . $app . '.svg'; - if (file_exists($appIcon)) { - $info['icon'] = $urlGenerator->imagePath($app, $app . '.svg'); - } else { - $appIcon = $appPath . '/img/app.svg'; - if (file_exists($appIcon)) { - $info['icon'] = $urlGenerator->imagePath($app, 'app.svg'); - } - } - } + $info['icon'] = $appManager->getAppIcon($app, dark: true) + ?? $appManager->getAppIcon($app); + // fix documentation if (isset($info['documentation']) && is_array($info['documentation'])) { foreach ($info['documentation'] as $key => $url) {