Skip to content

Commit

Permalink
fix create typing
Browse files Browse the repository at this point in the history
  • Loading branch information
H34D committed Mar 17, 2023
1 parent 5e12918 commit 27e4083
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -6,7 +6,9 @@ export const InterfaceCreateIdentity = (): JSX.Element => {
const { handlePurchaseIdentity, isLoading } = useMasa();

const createIdentity = useCallback(async () => {
await handlePurchaseIdentity?.();
if (handlePurchaseIdentity) {
await handlePurchaseIdentity();
}
}, [handlePurchaseIdentity]);

if (isLoading) return <MasaLoading />;
Expand Down
8 changes: 3 additions & 5 deletions src/provider/modules/identity/identity.ts
Expand Up @@ -12,7 +12,7 @@ export const useIdentity = (
identityId?: BigNumber;
address?: string;
};
handlePurchaseIdentity: () => Promise<boolean | undefined>;
handlePurchaseIdentity: () => Promise<boolean>;
handlePurchaseIdentityWithSoulname: (
paymentMethod: PaymentMethod,
soulname: string,
Expand Down Expand Up @@ -48,10 +48,8 @@ export const useIdentity = (
}
);

const handlePurchaseIdentity = useCallback(async (): Promise<
boolean | undefined
> => {
const created: boolean | undefined = await masa?.identity.create();
const handlePurchaseIdentity = useCallback(async (): Promise<boolean> => {
const created: boolean = (await masa?.identity.create()) || false;
await queryClient.invalidateQueries(['identity']);
return created;
}, [masa]);
Expand Down

0 comments on commit 27e4083

Please sign in to comment.