From e1ab9fe1188e0d2ea77ba3e41a02a6eef5d16bb1 Mon Sep 17 00:00:00 2001 From: Arthur Jamet Date: Fri, 8 Sep 2023 09:09:18 +0200 Subject: [PATCH] Front: Fix an error that occured on prod, caused by the avatar's url --- .gitignore | 1 + front/components/UserAvatar.tsx | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 378d91e..50e2bf1 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ log.html node_modules/ ./front/coverage .venv +.DS_Store \ No newline at end of file diff --git a/front/components/UserAvatar.tsx b/front/components/UserAvatar.tsx index a2eb9c7..4fd7313 100644 --- a/front/components/UserAvatar.tsx +++ b/front/components/UserAvatar.tsx @@ -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 (