Skip to content

Commit 4b04421

Browse files
authored
Merge pull request #104 from blocknative/develop
Release 1.0.1
2 parents a5ac98f + d1e307b commit 4b04421

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.",
55
"keywords": [
66
"ethereum",

src/onboard.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@ import {
3131

3232
export { default as modules } from './modules'
3333

34+
let onboard: any
35+
3436
function init(initialization: Initialization): API {
37+
if (onboard) {
38+
console.warn('onboard has already been initialized')
39+
onboard.$destroy()
40+
}
41+
3542
validateInit(initialization)
3643

3744
const { subscriptions, dappId, networkId, modules, darkMode } = initialization
@@ -47,7 +54,7 @@ function init(initialization: Initialization): API {
4754
darkMode
4855
}))
4956

50-
new Onboard({
57+
onboard = new Onboard({
5158
target: document.body,
5259
props: {
5360
walletSelectModule: modules.walletSelect,

0 commit comments

Comments
 (0)