Skip to content

Commit 2112720

Browse files
committed
fix(options): added flag for TEST_OPTIONS to prevent mainnet hang
1 parent 2779422 commit 2112720

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/state/options/hooks.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { useActiveWeb3React } from '@/hooks/user/index'
2222
import { useAddNotif } from '@/state/notifs/hooks'
2323
import { STABLECOINS } from '@/constants/index'
2424
import { optionAddresses } from '@/constants/options'
25+
import { testAddresses } from '../../constants/options'
2526
const { ChainId } = SushiSwapSDK
2627

2728
export const useOptions = (): OptionsState => {
@@ -71,9 +72,12 @@ export const useUpdateOptions = (): ((
7172
assetName === '' || assetName === 'WETH'
7273
? 'eth'
7374
: assetName.toLowerCase()
74-
const testAddresses = TEST_OPTIONS[key][chainId]?.map(
75-
(option) => option.address
76-
)
75+
let testAddresses
76+
if (TEST_OPTIONS[key]) {
77+
testAddresses = TEST_OPTIONS[key][chainId]?.map(
78+
(option) => option.address
79+
)
80+
}
7781
Protocol.getOptionsUsingMultiCall(
7882
chainId,
7983
isTestnet ? testAddresses : optionAddresses,

0 commit comments

Comments
 (0)