diff --git a/src/app/state/DelegationV2State.tsx b/src/app/state/DelegationV2State.tsx index f7564108..1089c6b9 100644 --- a/src/app/state/DelegationV2State.tsx +++ b/src/app/state/DelegationV2State.tsx @@ -37,20 +37,6 @@ export function DelegationV2State({ children }: PropsWithChildren) { [], ); - // // Effects - // useEffect( - // function syncDelegations() { - // if (!data?.delegations) { - // return; - // } - // // TODO: Find the difference and update only the difference - // if (!areDelegationsEqual(delegations, data.delegations)) { - // setDelegations(data.delegations); - // } - // }, - // [data?.delegations, delegations, setDelegations], - // ); - // Methods const addDelegation = useCallback( (newDelegation: DelegationV2) => { @@ -76,8 +62,6 @@ export function DelegationV2State({ children }: PropsWithChildren) { [delegations], ); - console.log(delegations, data?.delegations); - // Context const state = useMemo( () => ({ @@ -102,18 +86,3 @@ export function DelegationV2State({ children }: PropsWithChildren) { } export const useDelegationV2State = useState; - -function areDelegationsEqual( - arr1: DelegationV2[], - arr2: DelegationV2[], -): boolean { - if (arr1.length !== arr2.length) return false; - - return arr1.every((item, index) => { - const other = arr2[index]; - return ( - item.stakingTxHashHex === other.stakingTxHashHex && - item.state === other.state - ); - }); -}