fix: serve bundled logo if no custom logo is set (#1748)

This commit is contained in:
Alessandro (Ale) Segala
2026-09-14 11:33:31 +02:00
committed by GitHub
parent 41eb35b8a7
commit de2780bbef
9 changed files with 217 additions and 32 deletions
+10 -10
View File
@@ -10,18 +10,18 @@ type CachableImage = {
};
export const cachedApplicationLogo: CachableImage = {
getUrl: (light = true) => {
const url = new URL('/api/application-images/logo', window.location.origin);
if (!light) url.searchParams.set('light', 'false');
return getCachedImageUrl(url);
},
bustCache: (light = true) => {
const url = new URL('/api/application-images/logo', window.location.origin);
if (!light) url.searchParams.set('light', 'false');
bustImageCache(url);
}
getUrl: (light = true) => getCachedImageUrl(applicationLogoUrl(light)),
bustCache: (light = true) => bustImageCache(applicationLogoUrl(light))
};
// The UI renders its own default logo, so the bundled logo is skipped to be able to tell whether a custom logo has been uploaded
function applicationLogoUrl(light: boolean) {
const url = new URL('/api/application-images/logo', window.location.origin);
if (!light) url.searchParams.set('light', 'false');
url.searchParams.set('default', 'false');
return url;
}
export const cachedEmailLogo: CachableImage = {
getUrl: () => getCachedImageUrl(new URL('/api/application-images/email', window.location.origin)),
bustCache: () => bustImageCache(new URL('/api/application-images/email', window.location.origin))