Wallet connect takes me to trust wallet page

Could you try to login in https://forum-tests.vercel.app/ ?

Sign in message will be fixed in next versions. Could you try login to check if it will redirect to trustwallet website

Okay, the bug is not on your side. We need time to figure it out.

@Son

It’s an issue on wallet connect side. You can use solution from there:

Thanks for taking out time to figure this out, indeed the issue is with trust wallet, i made changes according to the link provided and it fixed the issue.

1 Like

What changes did you make?

I’m having this same issue and can’t seem to solve it.

Here’s my code:

try {
      setVisibleModal(true);
      setLoadingMessage("Authenticating through WalletConnect");
      Moralis.Web3.getSigningData = () => 'Welcome to SpacePath Marketplace! Please sign in to create an account.';
      await Moralis.Web3.authenticate({ provider: "walletconnect" }).then((user) => {
        try {
          window.localStorage.removeItem('WALLETCONNECT_DEEPLINK_CHOICE');
          if (user) {
            const accountStatus = user.get("accountVerified");
            setAuthenticationChecker(false);
            setAccountVerified(accountStatus);
            setVisibleModal(false);
          } else {
            setVisibleErrorModal(true);
            setVisibleModal(false);
          };

If you also know how to workaround this issue please let me know.

maybe this is the change:

For now I just remove WALLETCONNECT_DEEPLINK_CHOICE from localstorage as soon as user leaves the page to confirm the connection:

$doc.on('visibilitychange', () => {
	if (document.visibilityState === 'hidden') {
		window.localStorage.removeItem('WALLETCONNECT_DEEPLINK_CHOICE');
	}
});

there were more comments previously on that thread.

2 Likes

You should remove WALLETCONNECT_DEEPLINK_CHOICE from local storage outside the method.

So the code i used to fix in jquery/js is : in my main js file :-

document.addEventListener('visibilitychange', () => { 
    if (document.visibilityState === 'hidden') { 
        window.localStorage.removeItem('WALLETCONNECT_DEEPLINK_CHOICE'); 
    } 
});
2 Likes

Thanks for the help. This worked!

2 Likes

Hi
window.localStorage.removeItem('WALLETCONNECT_DEEPLINK_CHOICE'); works when the user chooses the wallet, but after on transaction confirm he must manually switch to the wallet. If window.localStorage.removeItem('WALLETCONNECT_DEEPLINK_CHOICE'); is not removed everything working fine except we still have “trust wallet page”