Front: Fix an error that occured on prod, caused by the avatar's url
This commit is contained in:
committed by
Clément Le Bihan
parent
8ab85ab689
commit
e1ab9fe118
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,3 +13,4 @@ log.html
|
||||
node_modules/
|
||||
./front/coverage
|
||||
.venv
|
||||
.DS_Store
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user