In order to reproduce the issue, the app should be refreshed and the wallet connected right after (Before the sdk without signer initialization process concludes), then you will see the "Connect Wallet" change to "Upgrade" on connection, then regressing to "Connect Wallet" after a few seconds.
The observed issue occurs because the SDK initializes at the launch of the decentralized application (dApp), and this initialization process is slower without a signer than with one. Specifically, when an account is connected, initialization with a signer is faster. However, if an account gets connected before the SDK has completed its initial setup, the SDK object reverts to the state it would be in if initialized without a signer.
A bug was found in
useInitializeTbtcSdk
hook that causes a racing condition.Video that illustrate the issue:
https://github.com/threshold-network/token-dashboard/assets/60587527/19a0594c-6468-4096-816c-c3137ef54baf
In order to reproduce the issue, the app should be refreshed and the wallet connected right after (Before the sdk without signer initialization process concludes), then you will see the "Connect Wallet" change to "Upgrade" on connection, then regressing to "Connect Wallet" after a few seconds.
The observed issue occurs because the SDK initializes at the launch of the decentralized application (dApp), and this initialization process is slower without a signer than with one. Specifically, when an account is connected, initialization with a signer is faster. However, if an account gets connected before the SDK has completed its initial setup, the SDK object reverts to the state it would be in if initialized without a signer.