rajatK012 / hashconnectWalletConnect

8 stars 7 forks source link

Can't maintain parity #3

Closed GameBully2K closed 2 years ago

GameBully2K commented 2 years ago

Each time you visit the site you have to go through the pairing process and it's added as a new DApp

image

I suspect the problem is in this part of the connect() process

image

woodwardmatt commented 2 years ago

@GameBully2K - I was seeing this behavior too. I found that if I updated the following line:

https://github.com/rajatK012/hashconnectWalletConnect/blob/5f79c02c550672b57e881d3441f3466d719ac6b5/src/HashConnectAPIProvider.tsx#L51

to match the name of the localStorage item (i.e. "hashconnectData" not " hashConnectData") at:

https://github.com/rajatK012/hashconnectWalletConnect/blob/5f79c02c550672b57e881d3441f3466d719ac6b5/src/HashConnectAPIProvider.tsx#L135

This allowed the localStorage item to be found and therefore load the connection information into the current props / state of the component and maintain the "Connected" state.

Hope that helps :)

woodwardmatt commented 2 years ago

Also just to note, that because your not going through re-pairing each time the dApp name does not then get duplicated within HashPack itself.

woodwardmatt commented 2 years ago

@rajatK012 - Just put in a PR to fix this typo :)

rajatK012 commented 2 years ago

Thanks @woodwardmatt I merged your request

GameBully2K commented 2 years ago

thanks @woodwardmatt good obsoveration skills