From 3f0e66bfb37bc547974087e9d9bf29a428a0c857 Mon Sep 17 00:00:00 2001 From: SteveM Date: Tue, 7 Jul 2020 18:36:36 -0700 Subject: [PATCH] emit error when closing via cancel as well, bump version to 2.1.0-RC.5.8 --- CHANGELOG.md | 7 +++++++ example/app/src/App.vue | 3 ++- npm-shrinkwrap.json | 2 +- package.json | 2 +- src/connectWindow/popUpCreator.js | 3 ++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c0e3f86..7cf5bffc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +### Release v2.1.0-RC.5.8 +- Emit error when popup is closed via closing the window or clicking cancel + +### Release v2.1.0-RC.5.7 +- Add option to emit error when popup is closed +- Design modifications + ### Release v2.1.0-RC.5.4 - Remove refreshing QRcode. - better error handling between V1 and V2 connection types diff --git a/example/app/src/App.vue b/example/app/src/App.vue index 9a6e63c0..2700d395 100644 --- a/example/app/src/App.vue +++ b/example/app/src/App.vue @@ -150,6 +150,7 @@ export default { mounted() { // Initialize the provider based client this.connect = new mewConnect.Provider({windowClosedError: true}); + // this.connect = new mewConnect.Provider(); // Create the MEWconnect web3 provider this.ethereum = this.connect.makeWeb3Provider(1) // Create a web3 instance using the MEWconnect web3 provider @@ -212,7 +213,7 @@ export default { console.log(`User's address is ${accounts[0]}`); this.userAddress = accounts[0]; }) - .catch(console.log) + .catch(console.error) }, disconnect() { this.connect.disconnect(); diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 6a71a13a..9a4d3366 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "@myetherwallet/mewconnect-web-client", - "version": "2.1.0-RC.5.6", + "version": "2.1.0-RC.5.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e9389bc5..8d57bb96 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@myetherwallet/mewconnect-web-client", "homepage": "https://github.com/myetherwallet/MEWconnect-web-client", - "version": "2.1.0-RC.5.7", + "version": "2.1.0-RC.5.8", "main": "./dist/index.js", "module": "./src/index.js", "scripts": { diff --git a/src/connectWindow/popUpCreator.js b/src/connectWindow/popUpCreator.js index 125a0840..c752a119 100644 --- a/src/connectWindow/popUpCreator.js +++ b/src/connectWindow/popUpCreator.js @@ -84,9 +84,9 @@ export default class PopUpCreator { const cancelButton = document.getElementById('NotificationButton2'); cancelButton.addEventListener('click', () => { - this.removeWindowClosedListener(); this.popupWindowOpen = false; this.hideNotifier(); + this.windowClosedListener(); this.closePopupWindow(); }); } @@ -174,6 +174,7 @@ export default class PopUpCreator { this.popupUrl = null; this.popupWindow = null; } + this.removeWindowClosedListener(); window.focus(); }