Skip to content

Commit e9a2719

Browse files
committed
fix: review
1 parent 169e0b5 commit e9a2719

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/Modal/internalPopstateGuard.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
let isInternal = false;
22

3+
/** Returns true when the next `popstate` was triggered by our own `history.back()`, not a real user back navigation. */
34
function isInternalPopstateInProgress(): boolean {
45
return isInternal;
56
}
67

8+
/** Runs `action` (e.g. `history.back()`) while flagging the resulting `popstate` as internal, so listeners can ignore it. */
79
function withInternalPopstate(action: () => void) {
810
isInternal = true;
911
const clear = () => {

src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ const loadAttachmentModalScreen = () => require<ReactComponentModule>('../../../
6565

6666
type Screens = Partial<Record<Screen, () => React.ComponentType>>;
6767

68-
// Reimbursement Account flow animations glitch on low-end Android devices in Chrome mWeb https://github.com/Expensify/App/issues/87658 so we intentionally disable them
6968
const IS_MOBILE_CHROME = isMobileChrome();
7069

7170
const REIMBURSEMENT_ACCOUNT_FLOW_SCREENS: Screen[] = [
@@ -143,6 +142,8 @@ const OPTIONS_PER_SCREEN: Partial<Record<Screen, PlatformStackNavigationOptions>
143142
[SCREENS.TWO_FACTOR_AUTH.SUCCESS]: {
144143
animationTypeForReplace: 'push',
145144
},
145+
// Reimbursement Account flow animations glitch on low-end Android devices in Chrome mWeb so we intentionally disable them here.
146+
// see https://github.com/Expensify/App/issues/87658
146147
...(IS_MOBILE_CHROME ? Object.fromEntries(REIMBURSEMENT_ACCOUNT_FLOW_SCREENS.map((screen) => [screen, {animation: Animations.NONE}])) : {}),
147148
};
148149

0 commit comments

Comments
 (0)