fix(ui): allow relative URLs in avatar validation
The isAvatarUrl check only accepted http://, https://, or data: URLs,
but the /avatar/{agentId} endpoint returns relative paths like /avatar/main.
This caused local file avatars to display as text instead of images.
Fixes avatar display for locally configured avatar files.
This commit is contained in:
@@ -158,7 +158,8 @@ function renderAvatar(
|
||||
function isAvatarUrl(value: string): boolean {
|
||||
return (
|
||||
/^https?:\/\//i.test(value) ||
|
||||
/^data:image\//i.test(value)
|
||||
/^data:image\//i.test(value) ||
|
||||
/^\//.test(value) // Relative paths from avatar endpoint
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user