Skip to content

Commit 5cf000e

Browse files
authored
fix: mf-6637 reset provider after cancel connect in popup (#12164)
1 parent e064e17 commit 5cf000e

File tree

2 files changed

+67
-66
lines changed

2 files changed

+67
-66
lines changed

packages/mask/popups/pages/Personas/ConnectWallet/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ export const Component = memo(function ConnectWalletPage() {
205205
navigate(-1)
206206
return
207207
}
208+
await EVMWeb3.connect({
209+
providerType: ProviderType.MaskWallet,
210+
})
208211
await Services.Helper.removePopupWindow()
209212
}, [signResult])
210213

packages/shared/src/UI/components/WalletStatusBar/WalletDescription.tsx

Lines changed: 64 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -64,71 +64,69 @@ export interface WalletDescriptionProps {
6464
verified?: boolean
6565
}
6666

67-
export const WalletDescription = memo<WalletDescriptionProps>(
68-
({
69-
onClick,
70-
providerIcon,
71-
networkIcon,
72-
iconFilterColor,
73-
name,
74-
address,
75-
formattedAddress,
76-
addressLink,
77-
onPendingClick,
78-
pending,
79-
verified,
80-
}) => {
81-
const { classes } = useStyles()
67+
export const WalletDescription = memo<WalletDescriptionProps>(function WalletDescription({
68+
onClick,
69+
providerIcon,
70+
networkIcon,
71+
iconFilterColor,
72+
name,
73+
address,
74+
formattedAddress,
75+
addressLink,
76+
onPendingClick,
77+
pending,
78+
verified,
79+
}) {
80+
const { classes } = useStyles()
8281

83-
return (
84-
<Box onClick={onClick} className={classes.root}>
85-
<WalletIcon
86-
size={30}
87-
badgeSize={12}
88-
mainIcon={providerIcon ?? networkIcon}
89-
badgeIcon={providerIcon ? networkIcon : undefined}
90-
iconFilterColor={iconFilterColor}
91-
/>
92-
<Box className={classes.description}>
93-
<Typography className={classes.walletName}>
94-
<span>{name}</span>
95-
{verified ?
96-
<Icons.Verification size={18} />
97-
: null}
98-
{onPendingClick ?
99-
<Icons.ArrowDrop />
100-
: null}
101-
</Typography>
102-
<Typography className={classes.address}>
103-
<span>{formattedAddress}</span>
104-
{address ?
105-
<CopyButton size={14} className={classes.linkIcon} text={address} />
106-
: null}
107-
<Link
108-
href={addressLink}
109-
target="_blank"
110-
title="View on Explorer"
111-
rel="noopener noreferrer"
112-
onClick={(event) => {
113-
event.stopPropagation()
114-
}}
115-
className={classes.linkIcon}>
116-
<Icons.LinkOut size={14} className={classes.linkIcon} />
117-
</Link>
118-
{pending ?
119-
<span
120-
className={classes.pending}
121-
onClick={(e) => {
122-
e.stopPropagation()
123-
onPendingClick?.()
124-
}}>
125-
<Trans>Pending</Trans>
126-
<LoadingBase size={12} className={classes.progress} />
127-
</span>
128-
: null}
129-
</Typography>
130-
</Box>
82+
return (
83+
<Box onClick={onClick} className={classes.root}>
84+
<WalletIcon
85+
size={30}
86+
badgeSize={12}
87+
mainIcon={providerIcon ?? networkIcon}
88+
badgeIcon={providerIcon ? networkIcon : undefined}
89+
iconFilterColor={iconFilterColor}
90+
/>
91+
<Box className={classes.description}>
92+
<Typography className={classes.walletName}>
93+
<span>{name}</span>
94+
{verified ?
95+
<Icons.Verification size={18} />
96+
: null}
97+
{onPendingClick ?
98+
<Icons.ArrowDrop />
99+
: null}
100+
</Typography>
101+
<Typography className={classes.address}>
102+
<span>{formattedAddress}</span>
103+
{address ?
104+
<CopyButton size={14} className={classes.linkIcon} text={address} />
105+
: null}
106+
<Link
107+
href={addressLink}
108+
target="_blank"
109+
title="View on Explorer"
110+
rel="noopener noreferrer"
111+
onClick={(event) => {
112+
event.stopPropagation()
113+
}}
114+
className={classes.linkIcon}>
115+
<Icons.LinkOut size={14} className={classes.linkIcon} />
116+
</Link>
117+
{pending ?
118+
<span
119+
className={classes.pending}
120+
onClick={(e) => {
121+
e.stopPropagation()
122+
onPendingClick?.()
123+
}}>
124+
<Trans>Pending</Trans>
125+
<LoadingBase size={12} className={classes.progress} />
126+
</span>
127+
: null}
128+
</Typography>
131129
</Box>
132-
)
133-
},
134-
)
130+
</Box>
131+
)
132+
})

0 commit comments

Comments
 (0)