From 6721c33a4386a3061dcf86f1e72de729ac053fcf Mon Sep 17 00:00:00 2001 From: huhuanming Date: Fri, 22 Nov 2024 12:38:24 +0800 Subject: [PATCH] fix: fix deeplink for market --- packages/kit/src/views/Earn/EarnHome.tsx | 4 ++-- packages/kit/src/views/Earn/earnUtils.ts | 2 +- packages/kit/src/views/Market/marketUtils.ts | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/kit/src/views/Earn/EarnHome.tsx b/packages/kit/src/views/Earn/EarnHome.tsx index 624fc8497b8..337b95e5308 100644 --- a/packages/kit/src/views/Earn/EarnHome.tsx +++ b/packages/kit/src/views/Earn/EarnHome.tsx @@ -58,7 +58,7 @@ import { useEarnActions, useEarnAtom } from '../../states/jotai/contexts/earn'; import { EARN_PAGE_MAX_WIDTH, EARN_RIGHT_PANEL_WIDTH } from './EarnConfig'; import { EarnProviderMirror } from './EarnProviderMirror'; -import { EarntNavigation } from './earnUtils'; +import { EarnNavigation } from './earnUtils'; interface ITokenAccount extends IEarnAccountToken { account: IEarnAccount; @@ -742,7 +742,7 @@ function BasicEarnHome() { const params = new URLSearchParams(query); const networkId = params.get('networkId'); if (provider && symbol && networkId) { - void EarntNavigation.pushDetailPageFromDeeplink(navigation, { + void EarnNavigation.pushDetailPageFromDeeplink(navigation, { accountId: account?.id ?? '', indexedAccountId: indexedAccount?.id, provider, diff --git a/packages/kit/src/views/Earn/earnUtils.ts b/packages/kit/src/views/Earn/earnUtils.ts index b1a80ccb4c7..eb9f2fa4129 100644 --- a/packages/kit/src/views/Earn/earnUtils.ts +++ b/packages/kit/src/views/Earn/earnUtils.ts @@ -2,7 +2,7 @@ import { EModalRoutes, EModalStakingRoutes } from '@onekeyhq/shared/src/routes'; import type { IAppNavigation } from '../../hooks/useAppNavigation'; -export const EarntNavigation = { +export const EarnNavigation = { async pushDetailPageFromDeeplink( navigation: IAppNavigation, { diff --git a/packages/kit/src/views/Market/marketUtils.ts b/packages/kit/src/views/Market/marketUtils.ts index f1e7a777964..a9010c55865 100644 --- a/packages/kit/src/views/Market/marketUtils.ts +++ b/packages/kit/src/views/Market/marketUtils.ts @@ -3,6 +3,7 @@ import platformEnv from '@onekeyhq/shared/src/platformEnv'; import { ETabMarketRoutes, ETabRoutes } from '@onekeyhq/shared/src/routes'; import type { IAppNavigation } from '../../hooks/useAppNavigation'; +import timerUtils from '@onekeyhq/shared/src/utils/timerUtils'; export function buildMarketFullUrl({ coinGeckoId }: { coinGeckoId: string }) { const origin = @@ -22,6 +23,9 @@ export const marketNavigation = { coinGeckoId: string; }, ) { + await timerUtils.wait(50); + navigation.switchTab(ETabRoutes.Market); + await timerUtils.wait(50); navigation.navigate(ETabRoutes.Market, { screen: ETabMarketRoutes.MarketDetail, params: {