Skip to content

Commit

Permalink
add try catch and remove filter on modal
Browse files Browse the repository at this point in the history
  • Loading branch information
NorbertBodziony committed Feb 27, 2024
1 parent 44295fb commit 262958d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 2 additions & 6 deletions sdk/packages/selector-base/src/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
WalletSelectorItem
} from '@nightlylabs/wallet-selector-modal'
import { type IWalletListItem, type NetworkData } from './types'
import { isMobileBrowser } from './utils'

export class NightlyConnectSelectorModal {
_modal: NightlySelector | undefined
Expand Down Expand Up @@ -44,12 +43,9 @@ export class NightlyConnectSelectorModal {
}

set walletsList(list: IWalletListItem[]) {
const filtered = list.filter((w) =>
isMobileBrowser() ? w.walletType !== 'extension' : w.walletType !== 'mobile'
)
this._walletsList = filtered
this._walletsList = list
if (this._modal) {
this._modal.selectorItems = filtered.map((item) => ({
this._modal.selectorItems = list.map((item) => ({
...item,
icon: item.image.default,
link: item.homepage
Expand Down
8 changes: 6 additions & 2 deletions sdk/packages/selector-polkadot/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,12 @@ export class NightlyConnectAdapter
) {
this.connectToMobileWallet(walletName)
} else {
await this.connectToStandardWallet(walletName)
resolve()
try {
await this.connectToStandardWallet(walletName)
resolve()
} catch (error) {
reject(error)
}
}
})

Expand Down

0 comments on commit 262958d

Please sign in to comment.