Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
fix networkOrDefault type and typo (#1528)
Browse files Browse the repository at this point in the history
* fix networkOrDefault type and typo

* WalletInfo type
  • Loading branch information
W3stside authored Oct 13, 2020
1 parent 556fc0b commit 9b22eef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/api/wallet/WalletApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export interface WalletApi {
export interface WalletInfo {
isConnected: boolean
userAddress?: string
networkId?: number
networkId?: Network
blockNumber?: number
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/TradeWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const TradeWidgetContainer: React.FC = () => {
const sellTokenSymbol = decodeSymbol(encodedSellTokenSymbol || '')
const receiveTokenSymbol = decodeSymbol(decodeReceiveTokenSymbol || '')

const { sellToken: initialSellTokenDefaultNetwork, buyToken: initialReceiveTokenDefaultNetwork } =
const { sellToken: initialSellTokenDefaultNetwork, receiveToken: initialReceiveTokenDefaultNetwork } =
initialTokenSelection.networks[networkIdOrDefault] || {}

const sellTokenWithFallback = useMemo(
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useWalletConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { BlockchainUpdatePrompt, WalletInfo } from 'api/wallet/WalletApi'

interface PendingStateObject extends WalletInfo {
pending: true
networkIdOrDefault: number
networkIdOrDefault: Network
}

const PendingState: PendingStateObject = {
Expand All @@ -33,7 +33,7 @@ const constructPendingState = ({ chainId, account, blockHeader }: BlockchainUpda
}

export const useWalletConnection = ():
| (WalletInfo & { pending: false; networkIdOrDefault: number })
| (WalletInfo & { pending: false; networkIdOrDefault: Network })
| PendingStateObject => {
const [walletInfo, setWalletInfo] = useSafeState<WalletInfo | null>(null)

Expand Down

0 comments on commit 9b22eef

Please sign in to comment.