diff --git a/.env.dev b/.env.dev index 74879a263b..66d33fd4bb 100644 --- a/.env.dev +++ b/.env.dev @@ -1,4 +1,3 @@ -VITE_DEFAULT_AGGREGATOR_API=https://meta-aggregator.dev.kyberengineering.io VITE_AGGREGATOR_API=https://aggregator-api.dev.kyberengineering.io VITE_AGGREGATOR_STATS_API=https://aggregator-stats.dev.kyberengineering.io VITE_SENTRY_DNS=https://d94ee2d3c22043bdaec966758680b5a8@sentry.ops.kyberengineering.io/4 diff --git a/.env.production b/.env.production index 5f433581ea..25a41bb57f 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,3 @@ -VITE_DEFAULT_AGGREGATOR_API=https://meta-aggregator-api.kyberswap.com VITE_AGGREGATOR_API=https://aggregator-api.kyberswap.com VITE_AGGREGATOR_STATS_API=https://aggregator-stats.kyberswap.com VITE_SENTRY_DNS=https://d94ee2d3c22043bdaec966758680b5a8@sentry.ops.kyberengineering.io/4 diff --git a/.env.stg b/.env.stg index 326145bd06..df9dddb900 100644 --- a/.env.stg +++ b/.env.stg @@ -1,4 +1,3 @@ -VITE_DEFAULT_AGGREGATOR_API=https://meta-aggregator.stg.kyberengineering.io VITE_AGGREGATOR_API=https://aggregator-api.stg.kyberengineering.io VITE_AGGREGATOR_STATS_API=https://aggregator-stats.kyberswap.com VITE_SENTRY_DNS=https://d94ee2d3c22043bdaec966758680b5a8@sentry.ops.kyberengineering.io/4 diff --git a/src/components/SubscribeButton/NotificationPreference/index.tsx b/src/components/SubscribeButton/NotificationPreference/index.tsx index 7f92a81bb7..f6d7253857 100644 --- a/src/components/SubscribeButton/NotificationPreference/index.tsx +++ b/src/components/SubscribeButton/NotificationPreference/index.tsx @@ -175,8 +175,6 @@ function NotificationPreference({ const [selectedTopic, setSelectedTopic] = useState([]) - const notFillEmail = !inputEmail - const updateTopicGroupsLocal = useCallback( (subIds: number[], unsubIds: number[]) => { const newTopicGroups = topicGroupsGlobal.map(group => { @@ -295,7 +293,7 @@ function NotificationPreference({ const isVerifiedEmail = userInfo?.email && inputEmail === userInfo?.email const needVerifyEmail = inputEmail && inputEmail !== userInfo?.email - const disableCheckbox = needVerifyEmail || notFillEmail || hasErrorInput + const disableCheckbox = hasErrorInput const isIncludePriceAlert = useCallback(() => { const changedData = getDiffChangeTopics(topicGroups) return ( @@ -315,7 +313,7 @@ function NotificationPreference({ const checkProfileAndSave = () => { if (disableButtonSave) return - if (!userInfo?.email && !isIncludePriceAlert()) { + if (needVerifyEmail && !isIncludePriceAlert()) { showVerifyModal() return } diff --git a/src/components/swapv2/SwapSettingsPanel/GasPriceTrackerSetting.tsx b/src/components/swapv2/SwapSettingsPanel/GasPriceTrackerSetting.tsx index 766820b96e..1b6f2d105b 100644 --- a/src/components/swapv2/SwapSettingsPanel/GasPriceTrackerSetting.tsx +++ b/src/components/swapv2/SwapSettingsPanel/GasPriceTrackerSetting.tsx @@ -4,7 +4,7 @@ import { isMobile } from 'react-device-detect' import { ChevronRight } from 'react-feather' import styled from 'styled-components' -import SettingLabel from 'components/swapv2/SwapSettingsPanel/SettingLabel' +import { TextDashed } from 'components/Tooltip' import useGasPriceFromDeBank, { GasLevel } from 'hooks/useGasPriceFromDeBank' import useTheme from 'hooks/useTheme' @@ -62,9 +62,9 @@ const GasPriceTrackerSetting: React.FC = ({ onClick }) => { return ( - + Gas Price Tracker - + {getPriceInGweiText(data[GasLevel.NORMAL].gasPriceInGwei)} diff --git a/src/constants/env.ts b/src/constants/env.ts index a99a4387df..27501c13fb 100644 --- a/src/constants/env.ts +++ b/src/constants/env.ts @@ -13,7 +13,6 @@ const required = (envKey: string): string => { export const GOOGLE_RECAPTCHA_KEY = required('GOOGLE_RECAPTCHA_KEY') export const PRICE_API = required('PRICE_API') -export const DEFAULT_AGGREGATOR_API = required('DEFAULT_AGGREGATOR_API') export const AGGREGATOR_API = required('AGGREGATOR_API') export const SENTRY_DNS = required('SENTRY_DNS') export const REWARD_SERVICE_API = required('REWARD_SERVICE_API') diff --git a/src/hooks/useKyberSwapConfig.ts b/src/hooks/useKyberSwapConfig.ts index 5ef8e6e7c0..60170afc8e 100644 --- a/src/hooks/useKyberSwapConfig.ts +++ b/src/hooks/useKyberSwapConfig.ts @@ -12,7 +12,7 @@ import { useLazyGetKyberswapConfigurationQuery, } from 'services/ksSetting' -import { DEFAULT_AGGREGATOR_API } from 'constants/env' +import { AGGREGATOR_API } from 'constants/env' import { NETWORKS_INFO, SUPPORTED_NETWORKS, isEVM, isSolana } from 'constants/networks' import ethereumInfo from 'constants/networks/ethereum' import solanaInfo from 'constants/networks/solana' @@ -65,8 +65,8 @@ const parseGlobalResponse = ( chainId: ChainId, ): KyberswapGlobalConfig => { const data = responseData?.data?.config - const aggregatorDomain = data?.aggregator ?? DEFAULT_AGGREGATOR_API - const isEnableAuthenAggregator = !data ? true : !!data?.isEnableAuthenAggregator + const aggregatorDomain = data?.aggregator ?? AGGREGATOR_API + const isEnableAuthenAggregator = !!data?.isEnableAuthenAggregator return { aggregatorDomain, aggregatorAPI: `${aggregatorDomain}/${NETWORKS_INFO[chainId].aggregatorRoute}/route/encode`, diff --git a/src/utils/iamError.ts b/src/utils/iamError.ts index e00f46b848..ccf46f6087 100644 --- a/src/utils/iamError.ts +++ b/src/utils/iamError.ts @@ -1,7 +1,7 @@ import { captureException } from '@sentry/react' import { AxiosError } from 'axios' -import { BFF_API, ENV_LEVEL } from 'constants/env' +import { BFF_API, ENV_KEY, ENV_LEVEL } from 'constants/env' import { AGGREGATOR_API_PATHS } from 'constants/index' import { ENV_TYPE } from 'constants/type' @@ -24,7 +24,7 @@ const sendError = (name: string, apiUrl: string, trackData: any) => { } // hot fix to prevent spam for now. -const blacklistPathBff = ['/v1/notification/me'] +const blacklistPathBff = ['/v1/notification/me', '/v1/tokens/score'] /** * check error status: blocked, maybe cors issues or server down @@ -52,6 +52,9 @@ export const checkIamDown = (axiosErr: AxiosError) => { statusCode, message: axiosErr?.message, code: axiosErr?.code, + tokenInfoSignIn: localStorage[`${ENV_KEY}_o2_sign_in`], + tokenInfoGuest: localStorage[`${ENV_KEY}_o2_guest`], + profileInfo: localStorage.redux_localstorage_simple_profile, } const apiUrl = axiosErr?.config?.url ?? ''