@@ -9,15 +9,16 @@ import {
99import { ARGENT_X_ICON } from "../connectors/injected/constants"
1010import type { ModalWallet , StoreVersion } from "../types/modal"
1111import { isInArgentMobileAppBrowser } from "../connectors/argent/helpers"
12- import { extractConnector , findConnectorById } from "./connector"
12+ import {
13+ extractConnector ,
14+ findConnectorById ,
15+ isCompoundConnector ,
16+ } from "./connector"
1317import { getStoreVersionFromBrowser } from "./getStoreVersionFromBrowser"
1418
1519interface SetConnectorsExpandedParams {
16- availableConnectors : (
17- | Connector
18- | StarknetkitConnector
19- | StarknetkitCompoundConnector
20- ) [ ]
20+ availableConnectors : ( Connector | StarknetkitConnector ) [ ]
21+ // | StarknetkitCompoundConnector
2122 installedWallets : StarknetWindowObject [ ]
2223 discoveryWallets : WalletProvider [ ]
2324 storeVersion : StoreVersion | null
@@ -41,23 +42,17 @@ export function getModalWallet(
4142 connectorOrCompoundConnector ,
4243 ) as StarknetkitConnector
4344
44- const isCompoundConnector = (
45- connectorOrCompoundConnector as StarknetkitCompoundConnector
46- ) . isCompoundConnector
45+ const isCompound = isCompoundConnector ( connectorOrCompoundConnector )
4746
4847 const downloads = discoveryWallets ?. find (
4948 ( d ) =>
5049 d . id === ( connector . id === "argentMobile" ? "argentX" : connector . id ) ,
5150 ) ?. downloads
5251
5352 return {
54- name : isCompoundConnector
55- ? connectorOrCompoundConnector . name
56- : connector . name ,
53+ name : isCompound ? connectorOrCompoundConnector . name : connector . name ,
5754 id : connector . id ,
58- icon : isCompoundConnector
59- ? connectorOrCompoundConnector . icon
60- : connector . icon ,
55+ icon : isCompound ? connectorOrCompoundConnector . icon : connector . icon ,
6156 connector : connectorOrCompoundConnector ,
6257 installed : true ,
6358 title :
@@ -103,8 +98,7 @@ export const mapModalWallets = ({
10398
10499 const connectors = orderedByInstall
105100 . map < ModalWallet | null > ( ( _c ) => {
106- const isCompoundConnector = ( _c as StarknetkitCompoundConnector )
107- . isCompoundConnector
101+ const isCompound = isCompoundConnector ( _c )
108102 const c = extractConnector ( _c )
109103
110104 const installed = installedWallets . find ( ( w ) => w . id === c ?. id )
@@ -113,7 +107,7 @@ export const mapModalWallets = ({
113107 let name
114108 let download
115109
116- if ( isCompoundConnector ) {
110+ if ( isCompound ) {
117111 icon = _c . icon
118112 name = _c . name
119113 } else {
0 commit comments