From 1538ab0bfabbedd2266868e14300e71c82775947 Mon Sep 17 00:00:00 2001 From: Nudesuppe42 Date: Sun, 2 Jun 2024 16:08:09 +0200 Subject: [PATCH] fix(permissions): :bug: Undefined slug --- src/pages/teams/[team]/manage/settings.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/teams/[team]/manage/settings.tsx b/src/pages/teams/[team]/manage/settings.tsx index f58afe99..64dd4d19 100644 --- a/src/pages/teams/[team]/manage/settings.tsx +++ b/src/pages/teams/[team]/manage/settings.tsx @@ -37,8 +37,8 @@ const Settings = ({ data: tempData }: any) => { const [allowSettings, setAllowSettings] = useState(false); useEffect(() => { - setAllowSettings(permissions.has('team.settings.edit', data.slug)); - setAllowSocial(permissions.has('team.socials.edit', data.slug)); + setAllowSettings(permissions.has('team.settings.edit', data?.slug)); + setAllowSocial(permissions.has('team.socials.edit', data?.slug)); }, [permissions]); const handleSave = (e: any) => { @@ -181,7 +181,7 @@ const Settings = ({ data: tempData }: any) => { }} seo={{ nofollow: true, noindex: true }} requiredPermissions={{ - buildteam: data.slug, + buildteam: data?.slug, permissions: ['team.settings.edit', 'team.socials.edit'], }} loading={!data}