ton-connect / sdk

SDK for TON Connect 2.0 — a comprehensive communication protocol between wallets and apps in TON ecosystem
Apache License 2.0
326 stars 92 forks source link

UI-REACT: Can't restore connection after calling tonConnectUI.disconnect() method #195

Open daniilkananenka opened 4 months ago

daniilkananenka commented 4 months ago

Describe the bug

I am developing Telegram Mini App with TONConnectUI I am using

const [tonConnectUI] = useTonConnectUI();

Then I have onClick function

const logoutClick = () => {
    tonConnectUI.disconnect();
}

And after it I try to use useIsConnectionRestored() which is infinitely. I can fix this only by closing Mini-App or reloading

Expected behavior

Correctly restoring TON connection after disconnect() method call

Current behavior

Descriped in bug

Steps to Reproduce

  1. Connect your TON wallet
  2. Disconnect wallet using disconnect() method
  3. Listen to useIsConnectionRestored() result

Environment

Telegram Mini App. Every OS

Additional context

No response