Skip to content

Commit

Permalink
fix: fix the issue where the tab route does not switch when opening t…
Browse files Browse the repository at this point in the history
…he market deeplink. (#6259)
  • Loading branch information
huhuanming authored Nov 22, 2024
1 parent c8e2017 commit d3905a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 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
11 changes: 6 additions & 5 deletions packages/kit/src/views/Market/marketUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { WEB_APP_URL } from '@onekeyhq/shared/src/config/appConfig';
import platformEnv from '@onekeyhq/shared/src/platformEnv';
import { ETabMarketRoutes, ETabRoutes } from '@onekeyhq/shared/src/routes';
import timerUtils from '@onekeyhq/shared/src/utils/timerUtils';

import type { IAppNavigation } from '../../hooks/useAppNavigation';

Expand All @@ -22,11 +23,11 @@ export const marketNavigation = {
coinGeckoId: string;
},
) {
navigation.navigate(ETabRoutes.Market, {
screen: ETabMarketRoutes.MarketDetail,
params: {
token: coinGeckoId,
},
await timerUtils.wait(80);
navigation.switchTab(ETabRoutes.Market);
await timerUtils.wait(80);
navigation.push(ETabMarketRoutes.MarketDetail, {
token: coinGeckoId,
});
},
};

0 comments on commit d3905a0

Please sign in to comment.