Skip to content

Commit fccf6b0

Browse files
authored
Merge pull request Expensify#65622 from bernhardoj/fix/64033-infinite-load-after-delete-moved-tx
Fix infinite loading after deleting moved transaction
2 parents 289dc75 + 00263aa commit fccf6b0

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

src/pages/home/ReportScreen.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,6 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
276276
const [isBannerVisible, setIsBannerVisible] = useState(true);
277277
const [scrollPosition, setScrollPosition] = useState<ScrollPosition>({});
278278

279-
const wasReportAccessibleRef = useRef(false);
280-
281279
const [isComposerFocus, setIsComposerFocus] = useState(false);
282280
const shouldAdjustScrollView = useMemo(() => isComposerFocus && !modal?.willAlertModalBecomeVisible, [isComposerFocus, modal]);
283281
const viewportOffsetTop = useViewportOffsetTop(shouldAdjustScrollView);
@@ -325,14 +323,6 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
325323
hideEmojiPicker(true);
326324
}, [prevIsFocused, isFocused]);
327325

328-
useEffect(() => {
329-
if (!report?.reportID) {
330-
wasReportAccessibleRef.current = false;
331-
return;
332-
}
333-
wasReportAccessibleRef.current = true;
334-
}, [report]);
335-
336326
const backTo = route?.params?.backTo as string;
337327
const onBackButtonPress = useCallback(() => {
338328
if (backTo === SCREENS.SEARCH.REPORT_RHP) {
@@ -451,7 +441,7 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
451441
}
452442

453443
// eslint-disable-next-line react-compiler/react-compiler
454-
if (!wasReportAccessibleRef.current && !firstRenderRef.current && !reportID && !isOptimisticDelete && !reportMetadata?.isLoadingInitialReportActions && !userLeavingStatus) {
444+
if (!firstRenderRef.current && !reportID && !isOptimisticDelete && !reportMetadata?.isLoadingInitialReportActions && !userLeavingStatus) {
455445
// eslint-disable-next-line react-compiler/react-compiler
456446
return true;
457447
}

0 commit comments

Comments
 (0)