Skip to content

Commit

Permalink
fix: show not installed view for keplr (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalabi2 authored Jan 8, 2025
1 parent b53fca2 commit d53121a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions components/react/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,17 @@ export const TailwindModal: React.FC<
return;
}

// Special case for keplr - check immediately
if (
wallet?.walletInfo.name === 'keplr-extension' &&
typeof window !== 'undefined' &&
!window.keplr
) {
setCurrentView(ModalView.NotExist);
setSelectedWallet(wallet);
return;
}

// Step 2: We do a small setTimeout to check for metamask extension error
// or if the wallet doesn't exist. This ensures the error message has time
// to populate in the wallet's state after calling `getWallet()`.
Expand Down
3 changes: 3 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interface Window {
keplr?: any;
}

0 comments on commit d53121a

Please sign in to comment.