Skip to content

Commit 183ce59

Browse files
authored
[core: 2.6.0-alpha.2] - [fix] - Autoselect with disabled modals resolve (#1154)
* Handles failed autoselect with disable modals * Increment version * Increment core version in React and Vue pkgs
1 parent c5d81ad commit 183ce59

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
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.6.0-alpha.1",
3+
"version": "2.6.0-alpha.2",
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/views/connect/Index.svelte

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@
5151
let windowWidth: number
5252
let scrollContainer: HTMLElement
5353
54-
let walletToAutoSelect =
55-
autoSelect.label &&
56-
walletModules.find(
57-
({ label }) => label.toLowerCase() === autoSelect.label.toLowerCase()
58-
)
59-
6054
const modalStep$ = new BehaviorSubject<keyof i18n['connect']>(
6155
'selectingWallet'
6256
)
@@ -209,13 +203,13 @@
209203
// user rejected account access
210204
if (code === ProviderRpcErrorCode.ACCOUNT_ACCESS_REJECTED) {
211205
connectionRejected = true
212-
if (walletToAutoSelect) {
213-
walletToAutoSelect = null
214206
215-
if (autoSelect.disableModals) {
216-
connectWallet$.next({ inProgress: false })
217-
}
207+
if (autoSelect.disableModals) {
208+
connectWallet$.next({ inProgress: false })
209+
} else if (autoSelect.label) {
210+
autoSelect.label = ''
218211
}
212+
219213
return
220214
}
221215
@@ -263,8 +257,17 @@
263257
modalStep$.pipe(takeUntil(onDestroy$)).subscribe(step => {
264258
switch (step) {
265259
case 'selectingWallet': {
266-
if (walletToAutoSelect) {
267-
autoSelectWallet(walletToAutoSelect)
260+
if (autoSelect.label) {
261+
const walletToAutoSelect = walletModules.find(
262+
({ label }) =>
263+
label.toLowerCase() === autoSelect.label.toLowerCase()
264+
)
265+
266+
if (walletToAutoSelect) {
267+
autoSelectWallet(walletToAutoSelect)
268+
} else if (autoSelect.disableModals) {
269+
connectWallet$.next({ inProgress: false })
270+
}
268271
} else {
269272
loadWalletsForSelection()
270273
}

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"typescript": "^4.5.5"
6363
},
6464
"dependencies": {
65-
"@web3-onboard/core": "^2.6.0-alpha.1",
65+
"@web3-onboard/core": "^2.6.0-alpha.2",
6666
"@web3-onboard/common": "^2.1.7-alpha.1",
6767
"use-sync-external-store": "1.0.0"
6868
},

packages/vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@vueuse/core": "^8.4.2",
6464
"@vueuse/rxjs": "^8.2.0",
6565
"@web3-onboard/common": "^2.1.7-alpha.1",
66-
"@web3-onboard/core": "^2.6.0-alpha.1",
66+
"@web3-onboard/core": "^2.6.0-alpha.2",
6767
"vue-demi": "^0.12.4"
6868
},
6969
"peerDependencies": {

0 commit comments

Comments
 (0)