Skip to content

Commit 12565a6

Browse files
authored
Merge pull request Expensify#82778 from daledah/fix/82622
fix: opening report deleted in offline is loading infinitely
2 parents 5776ac5 + 494cacc commit 12565a6

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/components/Search/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,10 @@ function Search({
904904

905905
const onSelectRow = useCallback(
906906
(item: SearchListItem, transactionPreviewData?: TransactionPreviewData) => {
907+
if (item.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
908+
return;
909+
}
910+
907911
if (isMobileSelectionModeEnabled) {
908912
toggleTransaction(item);
909913
return;

src/libs/actions/Report/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5702,6 +5702,19 @@ function deleteAppReport(
57025702
value: {hasOutstandingChildRequest: report?.hasOutstandingChildRequest},
57035703
});
57045704

5705+
if (hash) {
5706+
failureData.push({
5707+
onyxMethod: Onyx.METHOD.MERGE,
5708+
// @ts-expect-error - will be solved in https://github.com/Expensify/App/issues/73830
5709+
key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`,
5710+
value: {
5711+
data: {
5712+
[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]: {pendingAction: null},
5713+
},
5714+
},
5715+
});
5716+
}
5717+
57055718
const parameters: DeleteAppReportParams = {
57065719
reportID,
57075720
transactionIDToReportActionAndThreadData: JSON.stringify(transactionIDToReportActionAndThreadData),

src/pages/Search/SearchPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ function SearchPage({route}: SearchPageProps) {
507507
validTransactions,
508508
allTransactionViolations,
509509
bankAccountList,
510+
hash,
510511
);
511512
}
512513
} else {

0 commit comments

Comments
 (0)