Front: Fix an error that occured on prod, caused by the avatar's url

This commit is contained in:
Arthur Jamet
2023-09-08 09:09:18 +02:00
committed by Clément Le Bihan
parent 8ab85ab689
commit e1ab9fe118
2 changed files with 4 additions and 4 deletions
+3 -4
View File
@@ -18,10 +18,9 @@ const UserAvatar = ({ size }: UserAvatarProps) => {
if (!user.data) {
return null;
}
const url = new URL(user.data.data.avatar);
url.searchParams.append('updatedAt', user.dataUpdatedAt.toString());
return url;
// NOTE: We do this to avoid parsing URL with `new URL`, which is not compatible with related path
// (which is used for production, on web)
return `${user.data.data.avatar}?updatedAt=${user.dataUpdatedAt.toString()}`
}, [user.data]);
return (