fix: keep Control UI logo root-relative

This commit is contained in:
Shakker
2026-05-31 12:47:06 +01:00
committed by Shakker
parent 9577e0be5a
commit c06096eabc
2 changed files with 5 additions and 5 deletions

View File

@@ -111,15 +111,15 @@ describe("agentLogoUrl", () => {
expect(agentLogoUrl("/apps/openclaw/")).toBe("/apps/openclaw/favicon.svg");
});
it("uses a route-relative fallback before basePath bootstrap finishes", () => {
expect(agentLogoUrl("")).toBe("favicon.svg");
it("uses a root-relative fallback when no basePath is configured", () => {
expect(agentLogoUrl("")).toBe("/favicon.svg");
});
});
describe("assistantAvatarFallbackUrl", () => {
it("uses the bundled Molty png for assistant profile fallbacks", () => {
expect(assistantAvatarFallbackUrl("/ui")).toBe("/ui/apple-touch-icon.png");
expect(assistantAvatarFallbackUrl("")).toBe("apple-touch-icon.png");
expect(assistantAvatarFallbackUrl("")).toBe("/apple-touch-icon.png");
});
});

View File

@@ -245,12 +245,12 @@ export function resolveChatAvatarRenderUrl(
export function agentLogoUrl(basePath: string): string {
const base = normalizeOptionalString(basePath)?.replace(/\/$/, "") ?? "";
return base ? `${base}/favicon.svg` : "favicon.svg";
return base ? `${base}/favicon.svg` : "/favicon.svg";
}
export function assistantAvatarFallbackUrl(basePath: string): string {
const base = normalizeOptionalString(basePath)?.replace(/\/$/, "") ?? "";
return base ? `${base}/apple-touch-icon.png` : "apple-touch-icon.png";
return base ? `${base}/apple-touch-icon.png` : "/apple-touch-icon.png";
}
function isAvatarUrl(value: string): boolean {