Skip to content

Commit 4f1af64

Browse files
fix: cannot clone pool object
1 parent eedb570 commit 4f1af64

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

apps/main/src/dex/store/createPoolsSlice.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import produce from 'immer'
22
import type { UTCTimestamp } from 'lightweight-charts'
33
import chunk from 'lodash/chunk'
4-
import cloneDeep from 'lodash/cloneDeep'
54
import countBy from 'lodash/countBy'
65
import groupBy from 'lodash/groupBy'
76
import isNaN from 'lodash/isNaN'
@@ -483,11 +482,13 @@ const createPoolsSlice = (set: SetState<State>, get: GetState<State>): PoolsSlic
483482

484483
const tokens = curvejsApi.pool.poolTokens(poolData.pool, isWrapped)
485484
const tokenAddresses = curvejsApi.pool.poolTokenAddresses(poolData.pool, isWrapped)
486-
const cPoolData = cloneDeep(poolData)
487-
cPoolData.isWrapped = isWrapped
488-
cPoolData.tokens = tokens
489-
cPoolData.tokensCountBy = countBy(tokens)
490-
cPoolData.tokenAddresses = tokenAddresses
485+
const cPoolData = {
486+
...poolData,
487+
isWrapped,
488+
tokens,
489+
tokensCountBy: countBy(tokens),
490+
tokenAddresses,
491+
}
491492

492493
set(
493494
produce((state) => {

0 commit comments

Comments
 (0)