Skip to content

Commit

Permalink
fix(connect-kit): use-connected-action edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
runjuu committed Feb 21, 2023
1 parent eb15ff5 commit b35c05d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/connect-kit/src/hooks/use-connected-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ export function useConnectedAction<P extends any[], V>(
}
};

if (connectType !== "email" && wallet && !wallet?.characterId) {
// Wallet is connected but no character
callbackRef.current = callback;
useWalletMintNewCharacterModal.getState().show();
} else if (connectType === "wallet" && isEmailConnected) {
if (connectType === "wallet" && isEmailConnected) {
// Email is connected but require wallet connection
const emailCharacterId = email.characterId;

Expand All @@ -98,6 +94,10 @@ export function useConnectedAction<P extends any[], V>(
};

useUpgradeAccountModal.getState().show();
} else if (connectType !== "email" && wallet && !wallet?.characterId) {
// Wallet is connected but no character
callbackRef.current = callback;
useWalletMintNewCharacterModal.getState().show();
} else {
callbackRef.current = callback;
useConnectModal.getState().show();
Expand Down

0 comments on commit b35c05d

Please sign in to comment.