Skip to content

Commit

Permalink
set user permission state for intentionally
Browse files Browse the repository at this point in the history
  • Loading branch information
Da-Colon committed Mar 26, 2024
1 parent b61116b commit fc4b174
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/hooks/utils/useCanUserSubmitProposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export function useCanUserCreateProposal() {
* @returns {Promise<boolean>} - whether or not user has rights to create proposal either in global scope either for provided `safeAddress`.
*/
const getCanUserCreateProposal = useCallback(
async (safeAddress?: string): Promise<boolean> => {
async (safeAddress?: string): Promise<boolean | undefined> => {
if (!user.address || !safeAPI) {
return false;
return;
}

const checkIsMultisigOwner = (owners?: string[]) => {
Expand Down Expand Up @@ -76,10 +76,10 @@ export function useCanUserCreateProposal() {
);
return erc721LinearVotingContract.isProposer(user.address);
} else {
return false;
return;
}
}
return false;
return;
},
[
safe,
Expand All @@ -91,15 +91,15 @@ export function useCanUserCreateProposal() {
safeAPI,
baseContracts,
],
);
);
useEffect(() => {
const loadCanUserCreateProposal = async () => {
setCanUserCreateProposal(await getCanUserCreateProposal());
};
if (canUserCreateProposal === undefined) {
loadCanUserCreateProposal();
}
}, [getCanUserCreateProposal, canUserCreateProposal]);
}, [getCanUserCreateProposal, canUserCreateProposal, user]);

return { canUserCreateProposal, getCanUserCreateProposal };
}

0 comments on commit fc4b174

Please sign in to comment.