Skip to content

Commit 99b4748

Browse files
authored
Fix: Re-initialize Cleanup Logic (#1213)
* Move re-init check to top of init * Increment versions
1 parent 344d5b4 commit 99b4748

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/core",
3-
"version": "2.7.0-alpha.4",
3+
"version": "2.7.0-alpha.5",
44
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",

packages/core/src/index.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,16 @@ function init(options: InitOptions): OnboardAPI {
9292
connect
9393
} = options
9494

95+
const { device, svelteInstance } = configuration
96+
97+
if (svelteInstance) {
98+
// if already initialized, need to cleanup old instance
99+
console.warn('Re-initializing Onboard and resetting back to initial state')
100+
reset$.next()
101+
}
102+
95103
initI18N(i18n)
96104
addChains(chainIdToHex(chains))
97-
const { device, svelteInstance } = configuration
98105

99106
if (typeof connect !== undefined) {
100107
updateConnectModal(connect)
@@ -193,12 +200,6 @@ function init(options: InitOptions): OnboardAPI {
193200
updateNotify(notifyUpdate)
194201
}
195202

196-
if (svelteInstance) {
197-
// if already initialized, need to cleanup old instance
198-
console.warn('Re-initializing Onboard and resetting back to initial state')
199-
reset$.next()
200-
}
201-
202203
const app = svelteInstance || mountApp()
203204

204205
updateConfiguration({

packages/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/react",
3-
"version": "2.2.6-alpha.2",
3+
"version": "2.2.6-alpha.3",
44
"description": "A collection of React hooks for integrating Web3-Onboard in to React and Next.js projects. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -62,7 +62,7 @@
6262
"typescript": "^4.5.5"
6363
},
6464
"dependencies": {
65-
"@web3-onboard/core": "^2.7.0-alpha.4",
65+
"@web3-onboard/core": "^2.7.0-alpha.5",
6666
"@web3-onboard/common": "^2.1.8-alpha.1",
6767
"use-sync-external-store": "1.0.0"
6868
},

packages/vue/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/vue",
3-
"version": "2.1.6-alpha.2",
3+
"version": "2.1.6-alpha.3",
44
"description": "A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -63,7 +63,7 @@
6363
"@vueuse/core": "^8.4.2",
6464
"@vueuse/rxjs": "^8.2.0",
6565
"@web3-onboard/common": "^2.1.8-alpha.1",
66-
"@web3-onboard/core": "^2.7.0-alpha.4",
66+
"@web3-onboard/core": "^2.7.0-alpha.5",
6767
"vue-demi": "^0.12.4"
6868
},
6969
"peerDependencies": {

0 commit comments

Comments
 (0)