mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-13 01:02:25 -06:00
fix(ui): fall back to the default avatar when a profile image fails to load (#28270)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user