Skip to content

Commit a599d05

Browse files
committed
Merge branch 'v2-web3-onboard-develop' into release/2.7.0
2 parents d376ced + 99b4748 commit a599d05

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

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({

0 commit comments

Comments
 (0)