Skip to content

Commit

Permalink
Modal opening fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hide-on-bush-x committed May 9, 2023
1 parent cec2e23 commit 6c65b15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Expand Up @@ -14,6 +14,7 @@ export const InterfaceAuthenticate = (): JSX.Element => {
isLoggedIn,
useRainbowKit,
connect,
isModalOpen
} = useMasa();
const { isConnected } = useAccount();
const { disconnect } = useDisconnect();
Expand All @@ -23,10 +24,10 @@ export const InterfaceAuthenticate = (): JSX.Element => {
}, [disconnect]);

useEffect(() => {
if (isConnected && !isLoggedIn) {
if (isModalOpen && isConnected && !isLoggedIn) {
connect?.();
}
}, [connect, isConnected, isLoggedIn]);
}, [connect, isConnected, isLoggedIn, isModalOpen]);
const [copied, setCopied] = useState(false);

const message = useMemo(() => {
Expand Down
1 change: 1 addition & 0 deletions src/provider/masa-context-provider.tsx
Expand Up @@ -228,6 +228,7 @@ export const MasaContextProvider = ({
});

openConnectModal?.();
console.log("OPENING MODAL")
} else {
setModalOpen(true);
}
Expand Down
1 change: 1 addition & 0 deletions src/provider/modules/modal/modal.ts
Expand Up @@ -24,6 +24,7 @@ export const useModal = (
const [modalCallback, setModalCallback] = useState<(() => void) | null>(null);
const [forcedPage, setForcedPage] = useState<null | string>(null);


const [modalSize, setModalSize] = useState<{
width: number;
height: number;
Expand Down

0 comments on commit 6c65b15

Please sign in to comment.