Skip to content

Commit 0541f2e

Browse files
authored
Merge pull request Expensify#67308 from thelullabyy/fix/66625-expense-deleted-on-OD-cause-blank-report
Expenses Deleted on OD Cause Blank Report View on ND
2 parents 81d455f + 030562f commit 0541f2e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/pages/home/ReportScreen.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
304304
[reportTransactions, isOffline],
305305
);
306306
const reportTransactionIDs = useMemo(() => visibleTransactions?.map((transaction) => transaction.transactionID), [visibleTransactions]);
307+
307308
const transactionThreadReportID = getOneTransactionThreadReportID(report, chatReport, reportActions ?? [], isOffline, reportTransactionIDs);
308309
const [transactionThreadReportActions = getEmptyObject<OnyxTypes.ReportActions>()] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`, {
309310
canBeMissing: true,
@@ -496,6 +497,15 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
496497
reportActionIDFromRoute,
497498
]);
498499

500+
const prevTransactionThreadReportID = usePrevious(transactionThreadReportID);
501+
useEffect(() => {
502+
if (!!prevTransactionThreadReportID || !transactionThreadReportID) {
503+
return;
504+
}
505+
506+
fetchReport();
507+
}, [fetchReport, prevTransactionThreadReportID, transactionThreadReportID]);
508+
499509
useEffect(() => {
500510
if (!reportID || !isFocused) {
501511
return;

0 commit comments

Comments
 (0)