Skip to content

Commit

Permalink
feat: prevent old modal open callback from firing
Browse files Browse the repository at this point in the history
  • Loading branch information
simodrws committed Aug 4, 2023
1 parent 0a5a624 commit 14bea8a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/masa-interface/masa-interface.tsx
Expand Up @@ -60,7 +60,7 @@ export const MasaInterface = ({
}): JSX.Element => {
useMetamask({ disabled: disableMetamask });
const { isConnected } = useAccount();

console.log({ hideLegacyModal });
const {
isModalOpen,
setModalOpen,
Expand Down Expand Up @@ -274,9 +274,8 @@ export const MasaInterface = ({
[page]
);

return hideLegacyModal ? (
<></>
) : (
if (hideLegacyModal) return <div />;
return (
<ModalComponent
open={isModalOpen as boolean}
close={(): void => closeModal?.()}
Expand Down
2 changes: 2 additions & 0 deletions src/provider/masa-context-provider.tsx
Expand Up @@ -267,6 +267,7 @@ export const MasaContextProvider = ({

const connect = useCallback(
(options?: { scope?: string[]; callback?: () => void }) => {
if (hideLegacyModal) return;
if (verbose) {
console.info({ forcedPage, useRainbowKitWalletConnect, options });
}
Expand Down Expand Up @@ -306,6 +307,7 @@ export const MasaContextProvider = ({
openConnectModal,
verbose,
useRainbowKitWalletConnect,
hideLegacyModal,
// openAuthenticateModal,
// openConnectedModal,
// wagmiSigner,
Expand Down
1 change: 1 addition & 0 deletions stories/masa.stories.tsx
Expand Up @@ -245,6 +245,7 @@ const TemplateWithRainbowKit: Story = (props: Args) => {
company="Masa"
walletsToUse={['metamask', 'walletconnect', 'valora']}
useRainbowKitWalletConnect
hideLegacyModal
rainbowKitModalSize={'wide'}
contractAddressOverrides={{
SoulNameAddress: '0x9C78Bf97A6abf185C8878C13F1Fd5976C41dDCfa',
Expand Down

0 comments on commit 14bea8a

Please sign in to comment.