Skip to content

Commit 9cc9ee7

Browse files
Merge pull request #61918 from nextcloud/backport/61577/stable34
[stable34] fix(appstore): use proper app icon or adjust color if needed
2 parents 95c0a3f + 8e4f2dc commit 9cc9ee7

5 files changed

Lines changed: 10 additions & 19 deletions

File tree

apps/appstore/img/app-dark.svg

Lines changed: 1 addition & 1 deletion
Loading

apps/appstore/src/components/AppIcon.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ watch(() => app.icon, async () => {
2424
const response = await fetch(app.icon)
2525
if (response.ok) {
2626
svgIcon.value = await response.text()
27+
svgIcon.value = svgIcon.value
28+
.replaceAll(/(?<=[";])fill:\s?(#fff(fff)?|white)(;|(?="))/gi, '')
29+
.replaceAll(/(?<=\s)fill="[^"]+"/gi, '')
30+
.replaceAll(/(?<=\s)color="[^"]+"/gi, '')
2731
}
2832
}
2933
}, { immediate: true })

dist/appstore-main.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/appstore-main.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/private/legacy/OC_App.php

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -437,22 +437,9 @@ public function listAllApps(): array {
437437
$info['level'] = self::supportedApp;
438438
}
439439

440-
try {
441-
$appPath = $appManager->getAppPath($app);
442-
} catch (AppPathNotFoundException) {
443-
$appPath = false;
444-
}
445-
if ($appPath !== false) {
446-
$appIcon = $appPath . '/img/' . $app . '.svg';
447-
if (file_exists($appIcon)) {
448-
$info['icon'] = $urlGenerator->imagePath($app, $app . '.svg');
449-
} else {
450-
$appIcon = $appPath . '/img/app.svg';
451-
if (file_exists($appIcon)) {
452-
$info['icon'] = $urlGenerator->imagePath($app, 'app.svg');
453-
}
454-
}
455-
}
440+
$info['icon'] = $appManager->getAppIcon($app, dark: true)
441+
?? $appManager->getAppIcon($app);
442+
456443
// fix documentation
457444
if (isset($info['documentation']) && is_array($info['documentation'])) {
458445
foreach ($info['documentation'] as $key => $url) {

0 commit comments

Comments
 (0)