From a8d09f1a58ead32caf62babfa3dbf50c39baa2f1 Mon Sep 17 00:00:00 2001 From: Aaron Barnard Date: Wed, 7 Jul 2021 10:57:03 +1000 Subject: [PATCH 1/2] 1.6.2-0.1.0: [enhancement] - Destroy SDK (#198) * Destroy sdk if notify re-initialized * Update yarn.lock * Increment version --- package.json | 2 +- src/notify.ts | 4 ++-- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 75d8209..b14bb33 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bnc-notify", - "version": "1.6.2", + "version": "1.6.2-0.1.0", "description": "Show web3 users realtime transaction notifications", "keywords": [ "ethereum", diff --git a/src/notify.ts b/src/notify.ts index 2cccd19..919db33 100644 --- a/src/notify.ts +++ b/src/notify.ts @@ -67,11 +67,13 @@ import { createEmitter } from './utilities' import { version } from '../package.json' let notify: any +let blocknative function init(options: InitOptions): API { if (notify) { console.warn('notify has already been initialized') notify.$destroy() + blocknative && blocknative.destroy() } validateInit(options) @@ -85,8 +87,6 @@ function init(options: InitOptions): API { transactionHandlers.push(transactionHandler) } - let blocknative - if (dappId) { blocknative = new BlocknativeSdk({ dappId, diff --git a/yarn.lock b/yarn.lock index 14c8f99..ee38790 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1274,10 +1274,10 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -bnc-sdk@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-3.3.0.tgz#a690abe7570a43745936a308006fa52c1d806017" - integrity sha512-5MaL1uhKQn3dY3uBfW5HujXCS988/vMX0MY7LtkDjmA396a3DSbGcGySsHVsJZCBVopUupl0geI5w28+p8PG9g== +bnc-sdk@^3.3.4: + version "3.4.0" + resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-3.4.0.tgz#402874a4a794ccf5dd8ba8fba6925e24b38f772e" + integrity sha512-JVDDyIYucFQyq+ZfHSBVZG+R2Ophhdi+HIK5zj1gE2MYSCK/Ax8Budqys9/LyZkGdewWHZ5EWi2TUehxAbx0Rw== dependencies: crypto-es "^1.2.2" rxjs "^6.6.3" From d8268721cb5ed8e4000ad3783e9e40d7a37db788 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 8 Jul 2021 10:37:40 +1000 Subject: [PATCH 2/2] Increment version and update SDK --- package.json | 4 ++-- yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index b14bb33..e038a2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bnc-notify", - "version": "1.6.2-0.1.0", + "version": "1.7.0", "description": "Show web3 users realtime transaction notifications", "keywords": [ "ethereum", @@ -50,7 +50,7 @@ }, "dependencies": { "bignumber.js": "^9.0.0", - "bnc-sdk": "^3.3.4", + "bnc-sdk": "^3.4.1", "lodash.debounce": "^4.0.8", "regenerator-runtime": "^0.13.3", "uuid": "^3.3.3" diff --git a/yarn.lock b/yarn.lock index ee38790..dcb7fbc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1274,10 +1274,10 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -bnc-sdk@^3.3.4: - version "3.4.0" - resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-3.4.0.tgz#402874a4a794ccf5dd8ba8fba6925e24b38f772e" - integrity sha512-JVDDyIYucFQyq+ZfHSBVZG+R2Ophhdi+HIK5zj1gE2MYSCK/Ax8Budqys9/LyZkGdewWHZ5EWi2TUehxAbx0Rw== +bnc-sdk@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-3.4.1.tgz#fca070656a6efbfc489889ed0404e1b6289c17ff" + integrity sha512-GrZzN3zyqVOmtk++tvq/X1zchO+Bt9TIzw39xv7UkMLEUcs43pwj6XWphLRbqkrrILNSrLwOI0S8opyjffDFAA== dependencies: crypto-es "^1.2.2" rxjs "^6.6.3"