refac: profile_image_url optimization

This commit is contained in:
Timothy Jaeryang Baek
2025-11-20 20:43:59 -05:00
parent cd30152c83
commit 6442871947
28 changed files with 56 additions and 97 deletions
+2 -1
View File
@@ -14,6 +14,7 @@
import Notes from '$lib/components/notes/Notes.svelte';
import Tooltip from '$lib/components/common/Tooltip.svelte';
import Sidebar from '$lib/components/icons/Sidebar.svelte';
import { WEBUI_API_BASE_URL } from '$lib/constants';
let loaded = false;
@@ -95,7 +96,7 @@
>
<div class=" self-center">
<img
src={$user?.profile_image_url}
src={`${WEBUI_API_BASE_URL}/users/${$user?.id}/profile/image`}
class="size-6 object-cover rounded-full"
alt="User profile"
draggable="false"
+2 -2
View File
@@ -46,7 +46,7 @@
import { getAllTags, getChatList } from '$lib/apis/chats';
import { chatCompletion } from '$lib/apis/openai';
import { WEBUI_BASE_URL, WEBUI_HOSTNAME } from '$lib/constants';
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL, WEBUI_HOSTNAME } from '$lib/constants';
import { bestMatchingLanguage } from '$lib/utils';
import { setTextScale } from '$lib/utils/text-scale';
@@ -487,7 +487,7 @@
if ($settings?.notificationEnabled ?? false) {
new Notification(`${data?.user?.name} (#${event?.channel?.name}) • Open WebUI`, {
body: data?.content,
icon: data?.user?.profile_image_url ?? `${WEBUI_BASE_URL}/static/favicon.png`
icon: `${WEBUI_API_BASE_URL}/users/${data?.user?.id}/profile/image`
});
}
}