fix(ui): remove early return to render theme-aware favicon immediately

The previous implementation returned null when config was not yet loaded,
preventing the theme-aware favicon from rendering during initial page load.

Now uses optional chaining (config?.metaTitle, config?.customCss) throughout
so the <link rel="icon"> always renders with the correct theme-aware favicon
regardless of config loading state.

Fixes P1 issue from code review.
This commit is contained in:
Guillaume LECOMTE
2026-04-14 12:16:57 +02:00
parent 9be96d4195
commit 689ae51ee7
@@ -16,16 +16,14 @@ export function WhitelabelingProvider() {
: resolvedTheme === "light" ? "/icon-light.svg"
: "/icon.svg");
if (!config) return null;
return (
<>
<Head>
{config.metaTitle && <title>{config.metaTitle}</title>}
{config?.metaTitle && <title>{config.metaTitle}</title>}
<link rel="icon" href={faviconHref} key="app-favicon" />
</Head>
{config.customCss && (
{config?.customCss && (
<style
id="whitelabeling-styles"
dangerouslySetInnerHTML={{