diff --git a/next.config.mjs b/next.config.mjs index 4f8b30f..b28b9ee 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,4 @@ -const useProxy = false; +const useProxy = true; const nextConfig = { eslint: { diff --git a/src/features/staking/context/reducer.ts b/src/features/staking/context/reducer.ts index 41358b0..580db5f 100644 --- a/src/features/staking/context/reducer.ts +++ b/src/features/staking/context/reducer.ts @@ -58,7 +58,19 @@ const getUniqueValidators = ( // @TODO const getUniqueDelegations = ( delegations: NonNullable["items"], -) => delegations; +) => { + const validatorIds = new Set(); + + return delegations.filter((delegation) => { + if (validatorIds.has(delegation.validatorAddress)) { + return false; + } + + validatorIds.add(delegation.validatorAddress); + + return true; + }); +}; export const reducer = (state: StakingState, action: StakingAction) => { switch (action.type) { @@ -92,7 +104,7 @@ export const reducer = (state: StakingState, action: StakingAction) => { currentDelegations.currentPage += 1; currentDelegations.items = getUniqueDelegations( - currentDelegations.items.concat(action.content.items), + action.content.items.concat(currentDelegations.items), ); return { diff --git a/src/features/staking/lib/constants.ts b/src/features/staking/lib/constants.ts index 53b88cb..0cf441c 100644 --- a/src/features/staking/lib/constants.ts +++ b/src/features/staking/lib/constants.ts @@ -11,3 +11,4 @@ export const dashboardUrl = // : `${window.location.origin}/rpc`; export const rpcEndpoint = "https://rpc.xion-testnet-1.burnt.com:443"; +// export const rpcEndpoint = "https://rpc.xion-testnet.forbole.com";