fix(ui): fall back to the default avatar when a profile image fails to load (#28270)

This commit is contained in:
G30
2026-08-10 21:18:32 -04:00
committed by GitHub
parent 121f2404ee
commit 8836dcb59f
@@ -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;
}
}}
/>