Skip to content

Commit

Permalink
fix: use pure navigateBack instead of fixed route to unexpected behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
tanlethanh committed Jun 14, 2024
1 parent 7818254 commit ed63fe4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 33 deletions.
8 changes: 2 additions & 6 deletions apps/wallet/src/stacks/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import HistoryScreen from 'screens/Dashboard/History';
import ProfileScreen from 'screens/Dashboard/Home';
import { noHeaderNavigation } from 'utils/constants';
import type { DashboardParamList, HomeParamList } from 'utils/navigation';
import { navigate } from 'utils/navigation';
import { navigateBack } from 'utils/navigation';

type Props = StackScreenProps<DashboardParamList, 'Home'>;

Expand All @@ -22,11 +22,7 @@ export const HomeStack: FC<Props> = () => {
const ManagedHistoryScreen = useMemo(() => {
return withStackContainer(HistoryScreen, {
title: 'Transaction History',
goBack: () =>
navigate('Dashboard', {
screen: 'Home',
params: { screen: 'Default' },
}),
goBack: navigateBack,
});
}, []);

Expand Down
10 changes: 6 additions & 4 deletions apps/wallet/src/stacks/Setting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import { withStackContainer } from 'components/StackContainer';
import ReferralScreen from 'screens/Dashboard/Referral';
import SettingScreen from 'screens/Dashboard/Setting';
import { appState } from 'state/app';
import type { DashboardParamList, SettingParamList } from 'utils/navigation';
import {
type DashboardParamList,
navigateBack,
type SettingParamList,
} from 'utils/navigation';
import { useSnapshot } from 'valtio';

import { handleGoBackFromReferralScreen } from './utils';

type Props = StackScreenProps<DashboardParamList, 'Setting'>;

const Stack = createStackNavigator<SettingParamList>();
Expand All @@ -28,7 +30,7 @@ export const SettingStack: FC<Props> = () => {
return withStackContainer(ReferralScreen, {
title: 'Referral',
noBottomTabs: !navigationDisplay.isBottomTabActive,
goBack: handleGoBackFromReferralScreen,
goBack: navigateBack,
});
}, []);

Expand Down
10 changes: 0 additions & 10 deletions apps/wallet/src/stacks/Setting/utils.ts

This file was deleted.

13 changes: 0 additions & 13 deletions apps/wallet/src/stacks/Setting/utils.web.ts

This file was deleted.

0 comments on commit ed63fe4

Please sign in to comment.