Skip to content

Commit

Permalink
fix: fix deeplink for market
Browse files Browse the repository at this point in the history
  • Loading branch information
huhuanming committed Nov 22, 2024
1 parent c8e2017 commit 6721c33
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/kit/src/views/Earn/EarnHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/views/Earn/earnUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
{
Expand Down
4 changes: 4 additions & 0 deletions packages/kit/src/views/Market/marketUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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: {
Expand Down

0 comments on commit 6721c33

Please sign in to comment.