Skip to content

Commit 0ba841b

Browse files
committed
chore: Simplify
1 parent c92b81e commit 0ba841b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/web/src/views/FixedStaking/hooks/useStakedPools.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ export function useStakedPools(): FixedStakingPool[] {
165165
args: [],
166166
})
167167

168-
const numberOfPools = poolLength ? toNumber(poolLength.toString()) : 0
168+
const numberOfPools =
169+
poolLength && Number.isSafeInteger(toNumber(poolLength.toString())) && toNumber(poolLength.toString()) >= 0
170+
? toNumber(poolLength.toString())
171+
: 0
169172

170173
const fixedStakePools = useSingleContractMultipleData({
171174
contract: useMemo(
@@ -180,9 +183,6 @@ export function useStakedPools(): FixedStakingPool[] {
180183
() => Array.from(Array(numberOfPools).keys()).map((index) => [BigInt(index)] as const),
181184
[numberOfPools],
182185
),
183-
options: {
184-
enabled: Boolean(numberOfPools && Number.isSafeInteger(numberOfPools) && numberOfPools >= 0),
185-
},
186186
})
187187

188188
return useMemo(() => {

0 commit comments

Comments
 (0)