Skip to content

Commit

Permalink
refactor: add missing Connector after changing connect signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Cussone committed Nov 13, 2024
1 parent 09da0e2 commit f063b2f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/helpers/connector.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {
Connector,
StarknetkitCompoundConnector,
StarknetkitConnector,
} from "../connectors"

export function extractConnector(
connector: StarknetkitConnector | StarknetkitCompoundConnector,
connector: Connector | StarknetkitConnector | StarknetkitCompoundConnector,
useFallback: boolean = false,
) {
if ((connector as StarknetkitCompoundConnector).isCompoundConnector) {
Expand All @@ -16,7 +17,11 @@ export function extractConnector(
}

export function findConnectorById(
connectors: (StarknetkitConnector | StarknetkitCompoundConnector)[],
connectors: (
| Connector
| StarknetkitConnector
| StarknetkitCompoundConnector
)[],
id: string | null,
) {
const connector = connectors.find((c) => {
Expand Down
8 changes: 7 additions & 1 deletion src/helpers/mapModalWallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { WalletProvider } from "@starknet-io/get-starknet-core"
import { isString } from "lodash-es"
import type { StarknetWindowObject } from "@starknet-io/types-js"
import {
Connector,
StarknetkitCompoundConnector,
StarknetkitConnector,
} from "../connectors/connector"
Expand All @@ -12,7 +13,11 @@ import { extractConnector, findConnectorById } from "./connector"
import { getStoreVersionFromBrowser } from "./getStoreVersionFromBrowser"

interface SetConnectorsExpandedParams {
availableConnectors: (StarknetkitConnector | StarknetkitCompoundConnector)[]
availableConnectors: (
| Connector
| StarknetkitConnector
| StarknetkitCompoundConnector
)[]
installedWallets: StarknetWindowObject[]
discoveryWallets: WalletProvider[]
storeVersion: StoreVersion | null
Expand All @@ -21,6 +26,7 @@ interface SetConnectorsExpandedParams {

export function getModalWallet(
connectorOrCompoundConnector:
| Connector
| StarknetkitConnector
| StarknetkitCompoundConnector,
discoveryWallets?: WalletProvider[],
Expand Down
2 changes: 1 addition & 1 deletion src/types/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export type ModalWallet = {
downloads?: Record<string, string>
subtitle?: string
title?: string
connector: StarknetkitConnector | StarknetkitCompoundConnector
connector: Connector | StarknetkitConnector | StarknetkitCompoundConnector
}

export type Callback = (
Expand Down

0 comments on commit f063b2f

Please sign in to comment.