From 58933dc53e1d8903da51120408451baf8d087ef9 Mon Sep 17 00:00:00 2001 From: viet-nv Date: Tue, 3 Oct 2023 11:34:38 +0700 Subject: [PATCH] Revert "feat: add x-client-id to aggregator" This reverts commit 757661f1b7ac51b4922c737fec958721c466221e. --- src/pages/Farm/ElasticFarmCombination.tsx | 4 ++-- src/services/baseQueryOauth.ts | 5 ++--- src/services/route/index.ts | 10 +--------- src/state/farms/elasticv2/hooks.ts | 2 +- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/pages/Farm/ElasticFarmCombination.tsx b/src/pages/Farm/ElasticFarmCombination.tsx index 4a2b63258f..a523491696 100644 --- a/src/pages/Farm/ElasticFarmCombination.tsx +++ b/src/pages/Farm/ElasticFarmCombination.tsx @@ -111,8 +111,8 @@ export const ElasticFarmCombination: FC = () => { Note: Farms will run in{' '} - multiple phases. - {' '} + multiple phases + If you haven’t harvested your rewards for ended farms, you still can access them via the{' '} Ended diff --git a/src/services/baseQueryOauth.ts b/src/services/baseQueryOauth.ts index 378223fb48..8b6c1fce8a 100644 --- a/src/services/baseQueryOauth.ts +++ b/src/services/baseQueryOauth.ts @@ -1,5 +1,4 @@ import { KyberOauth2Api } from '@kybernetwork/oauth2' -import { FetchBaseQueryArgs } from '@reduxjs/toolkit/dist/query/fetchBaseQuery' import { BaseQueryFn, fetchBaseQuery } from '@reduxjs/toolkit/query' import axios from 'axios' @@ -34,11 +33,11 @@ const baseQueryOauth = // same as baseQueryOauth, but has flag to revert if meet incident export const baseQueryOauthDynamic = - ({ baseUrl = '', ...baseFetchOption }: FetchBaseQueryArgs): BaseQueryFn => + ({ baseUrl = '' }: { baseUrl?: string }): BaseQueryFn => async (args, WebApi, extraOptions) => { if (!args.authentication) { // to quickly revert if meet incident - const rawBaseQuery = fetchBaseQuery({ baseUrl, ...baseFetchOption }) + const rawBaseQuery = fetchBaseQuery({ baseUrl }) return rawBaseQuery(args, WebApi, extraOptions) } return queryWithTokenAndTracking(args, baseUrl) diff --git a/src/services/route/index.ts b/src/services/route/index.ts index 45ba974cc5..fa6db75847 100644 --- a/src/services/route/index.ts +++ b/src/services/route/index.ts @@ -6,9 +6,7 @@ import { GetRouteParams, GetRouteResponse } from './types/getRoute' const routeApi = createApi({ reducerPath: 'routeApi', - baseQuery: baseQueryOauthDynamic({ - baseUrl: '', - }), + baseQuery: baseQueryOauthDynamic({ baseUrl: '' }), endpoints: builder => ({ getRoute: builder.query< GetRouteResponse, @@ -22,9 +20,6 @@ const routeApi = createApi({ url, params, authentication, - headers: { - 'x-client-id': 'kyberswap', - }, }), }), buildRoute: builder.mutation< @@ -37,9 +32,6 @@ const routeApi = createApi({ body: payload, signal, authentication, - headers: { - 'x-client-id': 'kyberswap', - }, }), }), }), diff --git a/src/state/farms/elasticv2/hooks.ts b/src/state/farms/elasticv2/hooks.ts index 62d99a7b74..6ca22d31cd 100644 --- a/src/state/farms/elasticv2/hooks.ts +++ b/src/state/farms/elasticv2/hooks.ts @@ -70,7 +70,7 @@ export const useFilteredFarmsV2 = (farmAddress?: string) => { const updatedFarms = useMemo(() => { const newFarms = farms ?.filter(farm => { - if (farm?.endTime < Date.now() / 1000 || farm?.isSettled) return false + if (farm?.endTime < Date.now() / 1000) return false const isUserJoinThisFarm = userInfo?.find(item => item.fId === farm.fId) if (!isUserJoinThisFarm) return false