project-serum / serum-dex-ui

Example implementation of a UI for the Serum DEX
Other
356 stars 538 forks source link

sollet.io wallet gets disconnected when refresh dex page even if i checked keep wallet unlocked #7

Open dirmansebastian opened 4 years ago

dirmansebastian commented 4 years ago

if i refresh the https://dex.projectserum.com/#/ page while wallet is connected wallet gets disconnected even if i checked keep wallet unlocked, it also close the sollet.io window which says "Please keep this window open in the background."

zachcb commented 3 years ago

@dirmansebastian I was having the same issue. The window has a "beforeunload" listener. I'll probably create a PR to add a boolean for this. Not sure of the method yet.

_handleConnect = () => {
    if (!this._handlerAdded) {
      this._handlerAdded = true;
      window.addEventListener('message', this._handleMessage);
      window.addEventListener('beforeunload', this.disconnect);
    }

Sol Wallet Adapter: index.js#64

ateeqrehmani commented 3 years ago

@zachcb have you done with this?