fix(ui): resolve owner avatars against the API base url and add a fallback (#28272)

This commit is contained in:
G30 authored and GitHub committed 2026-08-11 11:05:35 -06:00
1 parent 29541cbb52
commit 25455e943d
2 files changed
+14 -2

No files matched your search

@@ -11,6 +11,7 @@
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import localizedFormat from 'dayjs/plugin/localizedFormat'; import localizedFormat from 'dayjs/plugin/localizedFormat';
import { getTimeRange } from '$lib/utils'; import { getTimeRange } from '$lib/utils';
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants';
import ChevronUp from '$lib/components/icons/ChevronUp.svelte'; import ChevronUp from '$lib/components/icons/ChevronUp.svelte';
import ChevronDown from '$lib/components/icons/ChevronDown.svelte'; import ChevronDown from '$lib/components/icons/ChevronDown.svelte';
import ChevronLeft from '$lib/components/icons/ChevronLeft.svelte'; import ChevronLeft from '$lib/components/icons/ChevronLeft.svelte';
@@ -240,9 +241,14 @@
{#if showOwnerInfo && chat.user_id && chat.owner_name} {#if showOwnerInfo && chat.user_id && chat.owner_name}
<Tooltip content={chat.owner_name}> <Tooltip content={chat.owner_name}>
<img <img
src="/api/v1/users/{chat.user_id}/profile/image" src="{WEBUI_API_BASE_URL}/users/{chat.user_id}/profile/image"
alt="" alt=""
class="size-4 rounded-full shrink-0 object-cover" class="size-4 rounded-full shrink-0 object-cover"
on:error={(e) => {
if (!e.currentTarget.src.endsWith('/static/favicon.png')) {
e.currentTarget.src = `${WEBUI_BASE_URL}/static/favicon.png`;
}
}}
/> />
</Tooltip> </Tooltip>
{/if} {/if}
@@ -16,6 +16,7 @@
<script lang="ts"> <script lang="ts">
import { toast } from 'svelte-sonner'; import { toast } from 'svelte-sonner';
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants';
import { goto, invalidate, invalidateAll } from '$app/navigation'; import { goto, invalidate, invalidateAll } from '$app/navigation';
import { onMount, getContext, createEventDispatcher, tick } from 'svelte'; import { onMount, getContext, createEventDispatcher, tick } from 'svelte';
import { LinkPreview } from 'bits-ui'; import { LinkPreview } from 'bits-ui';
@@ -508,9 +509,14 @@
{#if ownerUserId} {#if ownerUserId}
<Tooltip content={ownerName || 'Unknown'}> <Tooltip content={ownerName || 'Unknown'}>
<img <img
src="/api/v1/users/{ownerUserId}/profile/image" src="{WEBUI_API_BASE_URL}/users/{ownerUserId}/profile/image"
alt="" alt=""
class="size-3.5 rounded-full shrink-0 object-cover mr-1.5" class="size-3.5 rounded-full shrink-0 object-cover mr-1.5"
on:error={(e) => {
if (!e.currentTarget.src.endsWith('/static/favicon.png')) {
e.currentTarget.src = `${WEBUI_BASE_URL}/static/favicon.png`;
}
}}
/> />
</Tooltip> </Tooltip>
{/if} {/if}