refac: profile_image_url optimization
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user