Skip to content

Commit

Permalink
fix: as comments
Browse files Browse the repository at this point in the history
  • Loading branch information
songwongtp committed Feb 1, 2023
1 parent 7dc7aed commit fec2ff0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/lib/hooks/useAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const validateAddress = (
return null;
};

// TODO: refactor
export const useValidateAddress = () => {
const { currentChainRecord } = useWallet();

Expand Down
11 changes: 7 additions & 4 deletions src/lib/pages/instantiate/instantiate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,13 @@ const Instantiate = ({ onComplete }: InstantiatePageProps) => {
}
}, [codeIdQuery, msgQuery, reset, setValue]);

const validateAdmin = (input: string) =>
input && !!validateContractAddress(input) && !!validateUserAddress(input)
? "Invalid Address"
: undefined;
const validateAdmin = useCallback(
(input: string) =>
input && !!validateContractAddress(input) && !!validateUserAddress(input)
? "Invalid Address."
: undefined,
[validateContractAddress, validateUserAddress]
);

return (
<>
Expand Down

0 comments on commit fec2ff0

Please sign in to comment.