mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
fix(ui): fall back to the default avatar when a profile image fails to load (#28270)
This commit is contained in:
parent
121f2404ee
commit
8836dcb59f
1 changed files with 8 additions and 1 deletions
|
|
@ -6,7 +6,9 @@
|
|||
// LICENSE covers this Open WebUI fallback logo.
|
||||
// Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
// https://docs.openwebui.com/license.
|
||||
export let src = `${WEBUI_BASE_URL}/static/favicon.png`;
|
||||
const FALLBACK_SRC = `${WEBUI_BASE_URL}/static/favicon.png`;
|
||||
|
||||
export let src = FALLBACK_SRC;
|
||||
</script>
|
||||
|
||||
<img
|
||||
|
|
@ -15,4 +17,9 @@
|
|||
class=" {className} object-cover rounded-2xl"
|
||||
alt="profile"
|
||||
draggable="false"
|
||||
on:error={(e) => {
|
||||
if (!e.currentTarget.src.endsWith(FALLBACK_SRC)) {
|
||||
e.currentTarget.src = FALLBACK_SRC;
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue