From 37d4c5aedaa810b287d329fd87cd7c73aa060cb9 Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Thu, 26 Nov 2020 21:33:34 +0200 Subject: [PATCH] can't edit builds if not owner user --- pages/u/[identifier].tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pages/u/[identifier].tsx b/pages/u/[identifier].tsx index 453268072..1d28d8017 100644 --- a/pages/u/[identifier].tsx +++ b/pages/u/[identifier].tsx @@ -31,6 +31,8 @@ interface Props { peakXPowers: Partial>; } +// TODO: when fallback in production seems like the site will never load till F5 + const ProfilePage = (props: Props) => { const [showProfileModal, setShowProfileModal] = useState(false); const [buildToEdit, setBuildToEdit] = useState(false); @@ -123,7 +125,11 @@ const ProfilePage = (props: Props) => { build={build} m={2} showWeapon - onEdit={(build) => setBuildToEdit(build)} + onEdit={ + loggedInUser?.id === user.id + ? (build) => setBuildToEdit(build) + : undefined + } /> ))}