Skip to content
Draft
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
4 changes: 2 additions & 2 deletions src/components/FullscreenLoadingIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type FullScreenLoadingIndicatorProps = {
/** Size of the icon */
iconSize?: FullScreenLoadingIndicatorIconSize;

/** Whether the "Go Back" button appears after a timeout. */
/** Whether the "Go Back" button appears after a timeout. Defaults to true, pass false on screens where going back is dead or harmful (e.g. cold deep-link auth/transition screens). */
shouldUseGoBackButton?: boolean;

/** The ID of the test to be used for testing */
Expand All @@ -37,7 +37,7 @@ type FullScreenLoadingIndicatorProps = {
function FullScreenLoadingIndicator({
style,
iconSize = CONST.ACTIVITY_INDICATOR_SIZE.LARGE,
shouldUseGoBackButton = false,
shouldUseGoBackButton = true,
testID = '',
extraLoadingContext,
}: FullScreenLoadingIndicatorProps) {
Expand Down
3 changes: 2 additions & 1 deletion src/libs/Navigation/AppNavigator/DelegatorConnectGate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ function DelegatorConnectGuard({children}: {children: React.ReactNode}) {
}

return (
<Suspense fallback={<FullScreenLoadingIndicator />}>
// No "Go Back" button: this gate runs on a cold delegate connect, so there is usually no history to pop back to.
<Suspense fallback={<FullScreenLoadingIndicator shouldUseGoBackButton={false} />}>
<DelegatorConnectGate delegatorEmail={delegatorEmail}>{children}</DelegatorConnectGate>
</Suspense>
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/AvatarCropPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function AvatarCropPage() {
);

if (isLoadingDraft || !draft?.uri) {
return <FullScreenLoadingIndicator shouldUseGoBackButton />;
return <FullScreenLoadingIndicator />;
}

const onSave = (image: File | CustomRNImageManipulatorResult) => {
Expand Down
3 changes: 2 additions & 1 deletion src/pages/LogInWithShortLivedAuthTokenPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ function LogInWithShortLivedAuthTokenPage({route}: LogInWithShortLivedAuthTokenP
}, [route]);

if (account?.isLoading) {
return <FullScreenLoadingIndicator />;
// No "Go Back" button: this is a deep-link entry point, so there is usually no history to pop back to.
return <FullScreenLoadingIndicator shouldUseGoBackButton={false} />;
}

return <SessionExpiredPage />;
Expand Down
3 changes: 2 additions & 1 deletion src/pages/LogOutPreviousUserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ function LogOutPreviousUserPage({route}: LogOutPreviousUserPageProps) {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [initialURL, isAccountLoading]);

return <FullScreenLoadingIndicator />;
// No "Go Back" button: going back would pop /transition into the outgoing user's session mid sign-out.
return <FullScreenLoadingIndicator shouldUseGoBackButton={false} />;
}

export default LogOutPreviousUserPage;
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/EnterSignerInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function EnterSignerInfo({route}: EnterSignerInfoProps) {
}, [isEditing, moveTo, pageIndex, prevPage]);

if (isRedirecting) {
return <FullScreenLoadingIndicator shouldUseGoBackButton />;
return <FullScreenLoadingIndicator />;
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Search/SearchChangeApproverPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function SearchChangeApproverPage() {
);

if (!isOffline && isLoadingBulkChangeApproverPage) {
return <FullScreenLoadingIndicator shouldUseGoBackButton />;
return <FullScreenLoadingIndicator />;
}

return (
Expand Down
3 changes: 2 additions & 1 deletion src/pages/UnlinkLoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ function UnlinkLoginPage({route}: UnlinkLoginPageProps) {
};
}, [prevIsLoading, account?.isLoading]);

return <FullScreenLoadingIndicator />;
// No "Go Back" button: this is a deep-link entry point, so there is usually no history to pop back to.
return <FullScreenLoadingIndicator shouldUseGoBackButton={false} />;
}

export default UnlinkLoginPage;
3 changes: 2 additions & 1 deletion src/pages/ValidateLoginPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ function ValidateLoginPage({
});
}, [session?.autoAuthState]);

return <FullScreenLoadingIndicator />;
// No "Go Back" button: this is a deep-link entry point, so there is usually no history to pop back to.
return <FullScreenLoadingIndicator shouldUseGoBackButton={false} />;
}

export default ValidateLoginPage;
6 changes: 5 additions & 1 deletion src/pages/ValidateLoginPage/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ function ValidateLoginPage({
/>
)}
{((!effectiveAutoAuthState ? shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.SIGNING_IN) || isCompletingDirectSignIn) && (
<FullScreenLoadingIndicator testID="validate-login-loading" />
<FullScreenLoadingIndicator
// No "Go Back" button: this is a deep-link entry point, so there is usually no history to pop back to.
shouldUseGoBackButton={false}
testID="validate-login-loading"
/>
)}
</>
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/inbox/report/withReportOrNotFound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default function (shouldRequireReportID = true): <TProps extends WithRepo
}

if (shouldShowFullScreenLoadingIndicator) {
return <FullscreenLoadingIndicator shouldUseGoBackButton />;
return <FullscreenLoadingIndicator />;
}

if (shouldShowNotFoundPage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ function IOURequestStepConfirmation({
<ActivityIndicator size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE} />
</View>
) : (
<FullScreenLoadingIndicator shouldUseGoBackButton />
<FullScreenLoadingIndicator />
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function WithFullTransactionOrNotFoundImpl<TProps extends WithFullTransactionOrN
<ActivityIndicator size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE} />
</View>
) : (
<FullScreenLoadingIndicator shouldUseGoBackButton />
<FullScreenLoadingIndicator />
);
}
return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/Agents/AddAgentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function AddAgentPage({route}: AddAgentPageProps) {
const [template, templateMetadata] = useOnyx(ONYXKEYS.NEW_AGENT_TEMPLATE);

if (isLoadingOnyxValue(templateMetadata)) {
return <FullScreenLoadingIndicator shouldUseGoBackButton />;
return <FullScreenLoadingIndicator />;
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function PrivatePersonalDetailsPage() {
};

if (isLoadingApp) {
return <FullScreenLoadingIndicator shouldUseGoBackButton />;
return <FullScreenLoadingIndicator />;
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function AddPersonalNewCardPage() {
}, []);

if (isAddCardFeedLoading) {
return <FullScreenLoadingIndicator shouldUseGoBackButton />;
return <FullScreenLoadingIndicator />;
}

let CurrentStep: React.JSX.Element;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/AccessOrNotFoundWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ function AccessOrNotFoundWrapper({
// The feature linked to this page is disabled, so the redirect effect above will navigate to the More Features page.
// Render a loader instead of the page's children so the disabled page is never shown for a frame (avoids a visible flash).
if (shouldRedirectToMoreFeatures) {
return <FullscreenLoadingIndicator shouldUseGoBackButton />;
return <FullscreenLoadingIndicator />;
}
if (shouldShowNotFoundPage) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function WorkspaceExpensifyCardPage({route}: WorkspaceExpensifyCardPageProps) {
);
}
if (isLoading) {
return <FullScreenLoadingIndicator shouldUseGoBackButton />;
return <FullScreenLoadingIndicator />;
}
if (paymentBankAccountID) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,7 @@ function WorkspaceReceiptPartnersPage({route}: WorkspaceReceiptPartnersPageProps
policyFeature={CONST.POLICY.POLICY_FEATURE.MORE_FEATURES}
>
{isLoading ? (
<FullScreenLoadingIndicator
shouldUseGoBackButton
style={styles.flex1}
/>
<FullScreenLoadingIndicator style={styles.flex1} />
) : (
<ScreenWrapper
testID="WorkspaceReceiptPartnersPage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function SpendRuleCardPage({route}: SpendRuleCardPageProps) {
shouldBeBlocked={!canWriteCardSpendRules}
>
{isCardSettingsLoading ? (
<FullScreenLoadingIndicator shouldUseGoBackButton />
<FullScreenLoadingIndicator />
) : (
<ScreenWrapper
testID="SpendRuleCardPage"
Expand Down
Loading