iotex-desktop-wallet icon indicating copy to clipboard operation
iotex-desktop-wallet copied to clipboard

when lock wallet on ioPayDesktop, dapp can still read wallet from ws. we should lock ws too.

Open guo opened this issue 4 years ago • 2 comments

image

guo avatar Sep 10 '20 16:09 guo

repo steps:

  1. open https://iotex-dapp-sample.herokuapp.com/ or run this sample locally.
  2. unlock a wallet and make sure dapp-sample connected
  3. lock wallet (switch wallet)
  4. refresh dapp-sample. the dapp-sample can still connect. image

guo avatar Sep 10 '20 16:09 guo

we should resolve it by steps:

  1. renderer process should:
window['closeWss'] = () => ipcRederer.send('closeEvent');
  1. main process should listen ipcMain.on(closeEvent) and WsInstance.disconnect();

  2. in react state change: window.closeWss();

ZQ-jhon avatar Sep 19 '20 16:09 ZQ-jhon