Skip to content

Commit 4be655d

Browse files
[SDK] Fix onDisconnect callback not being invoked in React Native (#7850)
1 parent 74d4074 commit 4be655d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/many-tips-fail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix onDisconnect not being invoked in react native

packages/thirdweb/src/react/native/ui/connect/ConnectedModal.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ const ViewFunds = (props: ConnectedModalPropsInner) => {
293293
};
294294

295295
const DisconnectWallet = (props: ConnectedModalProps) => {
296-
const { wallet, account, theme, onClose } = props;
296+
const { wallet, account, theme, onClose, onDisconnect } = props;
297297
const { disconnect } = useDisconnect();
298298
const siweAuth = useSiweAuth(wallet, account, props.auth);
299299
return (
@@ -304,6 +304,10 @@ const DisconnectWallet = (props: ConnectedModalProps) => {
304304
if (siweAuth.isLoggedIn) {
305305
siweAuth.doLogout();
306306
}
307+
onDisconnect?.({
308+
wallet,
309+
account,
310+
});
307311
}}
308312
style={styles.walletMenuRow}
309313
>

0 commit comments

Comments
 (0)