diff --git a/src/components/Company/Edit/EditCompanyProfileForm.js b/src/components/Company/Edit/EditCompanyProfileForm.js index ef97ce57..3c70182d 100644 --- a/src/components/Company/Edit/EditCompanyProfileForm.js +++ b/src/components/Company/Edit/EditCompanyProfileForm.js @@ -132,7 +132,9 @@ export const EditCompanyController = () => { const fields = useWatch({ control }); - const shouldRevalidateEditingPermissions = useCallback(() => user?.isAdmin || user?.company?._id === id, [id, user]); + const shouldRevalidateEditingPermissions = useCallback(() => { + return user?.isAdmin || user?.company?._id === id; + }, [id, user]); const [canEdit, setCanEdit] = useState(undefined); @@ -220,7 +222,7 @@ const EditCompanyProfileForm = ({ title }) => { const Content = isMobile ? DialogContent : CardContent; - if (companyError || !canEdit) { + if (companyError || canEdit === false) { return ; }