Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ type MoneyRequestReportViewProps = {
/** Whether Report footer (that includes Composer) should be displayed */
shouldDisplayReportFooter: boolean;

/** Whether we should wait for the report to sync */
shouldWaitForReportSync: boolean;

/** The `backTo` route that should be used when clicking back button */
backToRoute: Route | undefined;
};
Expand Down Expand Up @@ -83,7 +80,7 @@ function InitialLoadingSkeleton({styles}: {styles: ThemeStyles}) {
);
}

function MoneyRequestReportView({report, policy, reportMetadata, shouldDisplayReportFooter, backToRoute, shouldWaitForReportSync}: MoneyRequestReportViewProps) {
function MoneyRequestReportView({report, policy, reportMetadata, shouldDisplayReportFooter, backToRoute}: MoneyRequestReportViewProps) {
const styles = useThemeStyles();
const {isOffline} = useNetwork();

Expand All @@ -108,7 +105,7 @@ function MoneyRequestReportView({report, policy, reportMetadata, shouldDisplayRe
const transactionThreadReportID = getOneTransactionThreadReportID(report, chatReport, reportActions ?? [], isOffline, reportTransactionIDs);
const isSentMoneyReport = useMemo(() => reportActions.some((action) => isSentMoneyReportAction(action)), [reportActions]);

const newTransactions = useNewTransactions(reportMetadata?.hasOnceLoadedReportActions, shouldWaitForReportSync ? [] : transactions);
const newTransactions = useNewTransactions(reportMetadata?.hasOnceLoadedReportActions, transactions);

const parentReportAction = useParentReportAction(report);

Expand Down Expand Up @@ -167,7 +164,7 @@ function MoneyRequestReportView({report, policy, reportMetadata, shouldDisplayRe
[backToRoute, isLoadingInitialReportActions, isTransactionThreadView, parentReportAction, policy, report, reportActions, transactionThreadReportID],
);

if (!!(isLoadingInitialReportActions && reportActions.length === 0 && !isOffline) || shouldWaitForTransactions || shouldWaitForReportSync) {
if (!!(isLoadingInitialReportActions && reportActions.length === 0 && !isOffline) || shouldWaitForTransactions) {
return <InitialLoadingSkeleton styles={styles} />;
}

Expand Down
3 changes: 0 additions & 3 deletions src/pages/Search/SearchMoneyRequestReportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) {

const reportIDFromRoute = getNonEmptyStringOnyxID(route.params?.reportID);
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportIDFromRoute}`, {allowStaleData: true, canBeMissing: true});
const shouldWaitForReportSync = report?.reportID !== reportIDFromRoute;

const [reportMetadata = defaultReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`, {canBeMissing: true, allowStaleData: true});
const [policies = getEmptyObject<NonNullable<OnyxCollection<Policy>>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {allowStaleData: true, canBeMissing: false});
Expand Down Expand Up @@ -134,7 +133,6 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) {
reportMetadata={reportMetadata}
policy={policy}
shouldDisplayReportFooter={isCurrentReportLoadedFromOnyx}
shouldWaitForReportSync={shouldWaitForReportSync}
key={report?.reportID}
backToRoute={route.params.backTo}
/>
Expand Down Expand Up @@ -171,7 +169,6 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) {
reportMetadata={reportMetadata}
policy={policy}
shouldDisplayReportFooter={isCurrentReportLoadedFromOnyx}
shouldWaitForReportSync={shouldWaitForReportSync}
key={report?.reportID}
backToRoute={route.params.backTo}
/>
Expand Down
Loading