Skip to content

Commit

Permalink
Fix Drawer not closing when clicking outside
Browse files Browse the repository at this point in the history
  • Loading branch information
gndelia committed Sep 6, 2024
1 parent e5215f7 commit 01f4bfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/components/connectWallets/connectWalletsDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Props = {
export const ConnectWalletsDrawer = function ({ closeDrawer }: Props) {
const { accountModalOpen } = useAccountModal()
const { chainModalOpen } = useChainModal()
const { openConnectModal } = useConnectModal()
const { connectModalOpen } = useConnectModal()
const t = useTranslations()

// Rainbow kit's modals appear on top of the drawer. By clicking on those
Expand All @@ -29,7 +29,7 @@ export const ConnectWalletsDrawer = function ({ closeDrawer }: Props) {
// Luckily, there are some hooks to detect that those modals are opened,
// and prevent this scenario.
const onClose = function () {
if (accountModalOpen || chainModalOpen || openConnectModal) {
if (accountModalOpen || chainModalOpen || connectModalOpen) {
return
}
closeDrawer()
Expand Down

0 comments on commit 01f4bfe

Please sign in to comment.