From fc4b1743607eb71f12093e03defefc2c53819b1f Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:42:38 -0400 Subject: [PATCH] set user permission state for intentionally --- src/hooks/utils/useCanUserSubmitProposal.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hooks/utils/useCanUserSubmitProposal.ts b/src/hooks/utils/useCanUserSubmitProposal.ts index dc072a7149..64ccc59cbf 100644 --- a/src/hooks/utils/useCanUserSubmitProposal.ts +++ b/src/hooks/utils/useCanUserSubmitProposal.ts @@ -26,9 +26,9 @@ export function useCanUserCreateProposal() { * @returns {Promise} - whether or not user has rights to create proposal either in global scope either for provided `safeAddress`. */ const getCanUserCreateProposal = useCallback( - async (safeAddress?: string): Promise => { + async (safeAddress?: string): Promise => { if (!user.address || !safeAPI) { - return false; + return; } const checkIsMultisigOwner = (owners?: string[]) => { @@ -76,10 +76,10 @@ export function useCanUserCreateProposal() { ); return erc721LinearVotingContract.isProposer(user.address); } else { - return false; + return; } } - return false; + return; }, [ safe, @@ -91,7 +91,7 @@ export function useCanUserCreateProposal() { safeAPI, baseContracts, ], - ); + ); useEffect(() => { const loadCanUserCreateProposal = async () => { setCanUserCreateProposal(await getCanUserCreateProposal()); @@ -99,7 +99,7 @@ export function useCanUserCreateProposal() { if (canUserCreateProposal === undefined) { loadCanUserCreateProposal(); } - }, [getCanUserCreateProposal, canUserCreateProposal]); + }, [getCanUserCreateProposal, canUserCreateProposal, user]); return { canUserCreateProposal, getCanUserCreateProposal }; }