Skip to content

Commit bb5ad3e

Browse files
committed
refactor: Update TonConnectInstance debugging log
1 parent ad65adf commit bb5ad3e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lib/components/Swap/Swap.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const SwapComponent: FC<SwapProps> = ({
3939
if (theme) {
4040
setTheme(theme);
4141
}
42+
console.log(tonConnectInstance);
4243
if (tonConnectInstance) {
4344
setTonConnectInstance(tonConnectInstance);
4445
}
@@ -52,14 +53,16 @@ export const SwapComponent: FC<SwapProps> = ({
5253
disconnect,
5354
} = useWalletStore();
5455
useEffect(() => {
55-
// tonConnectInstance.onStatusChange((wallet) => {
56-
// if (wallet) {
57-
// setWallet(wallet);
58-
// } else if (stateWallet && !wallet) {
59-
// disconnect();
60-
// }
61-
// });
56+
console.log(tonConnectInstance);
57+
tonConnectInstance.onStatusChange((wallet) => {
58+
if (wallet) {
59+
console.log(wallet);
60+
} else if (stateWallet && !wallet) {
61+
disconnect();
62+
}
63+
});
6264
if (tonConnectInstance.wallet) {
65+
console.log(tonConnectInstance.wallet);
6366
setWallet(tonConnectInstance.wallet);
6467
} else if (stateWallet && !tonConnectInstance.wallet) {
6568
disconnect();

0 commit comments

Comments
 (0)