Skip to content

Commit

Permalink
CR: update
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed May 20, 2024
1 parent 3533c1b commit a6ceba1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 49 deletions.
12 changes: 5 additions & 7 deletions apps/wallet-mobile/src/TxHistory/TxHistoryNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import {
} from '../navigation'
import {COLORS} from '../theme'
import {useFrontendFees, useStakingKey, useWalletName} from '../yoroi-wallets/hooks'
import {isMainnetNetworkId} from '../yoroi-wallets/utils'
import {ModalInfo} from './ModalInfo'
import {TxDetails} from './TxDetails'
import {TxHistory} from './TxHistory'
Expand All @@ -77,7 +76,6 @@ export const TxHistoryNavigator = () => {
const storage = useAsyncStorage()
const {atoms, color} = useTheme()
const {styles} = useStyles()
const isMainnet = isMainnetNetworkId(wallet.networkId)

// modal
const [isModalInfoVisible, setIsModalInfoVisible] = React.useState(false)
Expand All @@ -87,17 +85,17 @@ export const TxHistoryNavigator = () => {
const {frontendFees} = useFrontendFees(wallet)
const stakingKey = useStakingKey(wallet)
const swapManager = React.useMemo(() => {
const aggregatorTokenId = isMainnet ? milkTokenId.mainnet : milkTokenId.preprod
const aggregatorTokenId = wallet.isMainnet ? milkTokenId.mainnet : milkTokenId.preprod
const swapStorage = swapStorageMaker()
const swapApi = swapApiMaker({
isMainnet,
isMainnet: wallet.isMainnet,
stakingKey,
primaryTokenId: wallet.primaryTokenInfo.id,
supportedProviders,
})
const frontendFeeTiers = frontendFees?.[aggregator] ?? ([] as const)
return swapManagerMaker({swapStorage, swapApi, frontendFeeTiers, aggregator, aggregatorTokenId})
}, [isMainnet, stakingKey, wallet.primaryTokenInfo.id, frontendFees])
}, [wallet.isMainnet, wallet.primaryTokenInfo.id, stakingKey, frontendFees])

// resolver
const resolverManager = React.useMemo(() => {
Expand All @@ -108,12 +106,12 @@ export const TxHistoryNavigator = () => {
},
},
cslFactory: init,
isMainnet,
isMainnet: wallet.isMainnet,
})
const walletStorage = storage.join(`wallet/${wallet.id}/`)
const resolverStorage = resolverStorageMaker({storage: walletStorage})
return resolverManagerMaker(resolverStorage, resolverApi)
}, [storage, wallet.id, isMainnet])
}, [storage, wallet.id, wallet.isMainnet])

// claim
const claimApi = React.useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"start": {
"line": 435,
"column": 16,
"index": 17003
"index": 16958
},
"end": {
"line": 438,
"column": 3,
"index": 17092
"index": 17047
}
},
{
Expand All @@ -21,12 +21,12 @@
"start": {
"line": 439,
"column": 32,
"index": 17126
"index": 17081
},
"end": {
"line": 442,
"column": 3,
"index": 17239
"index": 17194
}
},
{
Expand All @@ -36,12 +36,12 @@
"start": {
"line": 443,
"column": 13,
"index": 17254
"index": 17209
},
"end": {
"line": 446,
"column": 3,
"index": 17327
"index": 17282
}
},
{
Expand All @@ -51,12 +51,12 @@
"start": {
"line": 447,
"column": 17,
"index": 17346
"index": 17301
},
"end": {
"line": 450,
"column": 3,
"index": 17423
"index": 17378
}
},
{
Expand All @@ -66,12 +66,12 @@
"start": {
"line": 451,
"column": 15,
"index": 17440
"index": 17395
},
"end": {
"line": 454,
"column": 3,
"index": 17513
"index": 17468
}
},
{
Expand All @@ -81,12 +81,12 @@
"start": {
"line": 455,
"column": 21,
"index": 17536
"index": 17491
},
"end": {
"line": 458,
"column": 3,
"index": 17631
"index": 17586
}
},
{
Expand All @@ -96,12 +96,12 @@
"start": {
"line": 459,
"column": 14,
"index": 17647
"index": 17602
},
"end": {
"line": 462,
"column": 3,
"index": 17728
"index": 17683
}
},
{
Expand All @@ -111,12 +111,12 @@
"start": {
"line": 463,
"column": 13,
"index": 17743
"index": 17698
},
"end": {
"line": 466,
"column": 3,
"index": 17823
"index": 17778
}
},
{
Expand All @@ -126,12 +126,12 @@
"start": {
"line": 467,
"column": 18,
"index": 17843
"index": 17798
},
"end": {
"line": 470,
"column": 3,
"index": 17944
"index": 17899
}
},
{
Expand All @@ -141,12 +141,12 @@
"start": {
"line": 471,
"column": 20,
"index": 17966
"index": 17921
},
"end": {
"line": 474,
"column": 3,
"index": 18055
"index": 18010
}
},
{
Expand All @@ -156,12 +156,12 @@
"start": {
"line": 475,
"column": 26,
"index": 18083
"index": 18038
},
"end": {
"line": 478,
"column": 3,
"index": 18187
"index": 18142
}
},
{
Expand All @@ -171,12 +171,12 @@
"start": {
"line": 479,
"column": 19,
"index": 18208
"index": 18163
},
"end": {
"line": 482,
"column": 3,
"index": 18301
"index": 18256
}
},
{
Expand All @@ -186,12 +186,12 @@
"start": {
"line": 483,
"column": 16,
"index": 18319
"index": 18274
},
"end": {
"line": 486,
"column": 3,
"index": 18405
"index": 18360
}
},
{
Expand All @@ -201,12 +201,12 @@
"start": {
"line": 487,
"column": 19,
"index": 18426
"index": 18381
},
"end": {
"line": 493,
"column": 3,
"index": 18664
"index": 18619
}
},
{
Expand All @@ -216,12 +216,12 @@
"start": {
"line": 494,
"column": 27,
"index": 18693
"index": 18648
},
"end": {
"line": 497,
"column": 3,
"index": 18786
"index": 18741
}
},
{
Expand All @@ -231,12 +231,12 @@
"start": {
"line": 498,
"column": 13,
"index": 18801
"index": 18756
},
"end": {
"line": 501,
"column": 3,
"index": 18876
"index": 18831
}
},
{
Expand All @@ -246,12 +246,12 @@
"start": {
"line": 502,
"column": 25,
"index": 18903
"index": 18858
},
"end": {
"line": 505,
"column": 3,
"index": 18977
"index": 18932
}
},
{
Expand All @@ -261,12 +261,12 @@
"start": {
"line": 506,
"column": 18,
"index": 18997
"index": 18952
},
"end": {
"line": 509,
"column": 3,
"index": 19111
"index": 19066
}
},
{
Expand All @@ -276,12 +276,12 @@
"start": {
"line": 510,
"column": 28,
"index": 19141
"index": 19096
},
"end": {
"line": 513,
"column": 3,
"index": 19237
"index": 19192
}
},
{
Expand All @@ -291,12 +291,12 @@
"start": {
"line": 514,
"column": 29,
"index": 19268
"index": 19223
},
"end": {
"line": 517,
"column": 3,
"index": 19376
"index": 19331
}
},
{
Expand All @@ -306,12 +306,12 @@
"start": {
"line": 518,
"column": 30,
"index": 19408
"index": 19363
},
"end": {
"line": 521,
"column": 3,
"index": 19518
"index": 19473
}
}
]

0 comments on commit a6ceba1

Please sign in to comment.