Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix report screen opened in background when starting QAB flow #50200

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/FocusTrap/TOP_TAB_SCREENS.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import type {TupleToUnion} from 'type-fest';
import CONST from '@src/CONST';

const TOP_TAB_SCREENS: string[] = [CONST.TAB.NEW_CHAT, CONST.TAB.NEW_ROOM, CONST.TAB_REQUEST.DISTANCE, CONST.TAB_REQUEST.MANUAL, CONST.TAB_REQUEST.SCAN];
const TOP_TAB_SCREENS = [CONST.TAB.NEW_CHAT, CONST.TAB.NEW_ROOM, CONST.TAB_REQUEST.DISTANCE, CONST.TAB_REQUEST.MANUAL, CONST.TAB_REQUEST.SCAN] as const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB: We could consider transferring these CONSTs to SCREENs because as a matter of fact they are screens; It would also match rest of screens listed in getAdaptedStateFromPath.ts, but I leave it for C+ to decide 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. NAB since it's already existing code


type TopTabScreen = TupleToUnion<typeof TOP_TAB_SCREENS>;

export type {TopTabScreen};

export default TOP_TAB_SCREENS;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {NavigationState, PartialState, Route} from '@react-navigation/nativ
import {findFocusedRoute, getStateFromPath} from '@react-navigation/native';
import pick from 'lodash/pick';
import type {TupleToUnion} from 'type-fest';
import type {TopTabScreen} from '@components/FocusTrap/TOP_TAB_SCREENS';
import {isAnonymousUser} from '@libs/actions/Session';
import getIsNarrowLayout from '@libs/getIsNarrowLayout';
import type {BottomTabName, CentralPaneName, FullScreenName, NavigationPartialRoute, RootStackParamList} from '@libs/Navigation/types';
Expand Down Expand Up @@ -29,7 +30,10 @@ const RHP_SCREENS_OPENED_FROM_LHN = [
SCREENS.SETTINGS.EXIT_SURVEY.REASON,
SCREENS.SETTINGS.EXIT_SURVEY.RESPONSE,
SCREENS.SETTINGS.EXIT_SURVEY.CONFIRM,
] satisfies Screen[];
CONST.TAB_REQUEST.DISTANCE,
CONST.TAB_REQUEST.MANUAL,
CONST.TAB_REQUEST.SCAN,
] satisfies Array<Screen | TopTabScreen>;

type RHPScreenOpenedFromLHN = TupleToUnion<typeof RHP_SCREENS_OPENED_FROM_LHN>;

Expand Down
Loading