Skip to content
Merged
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
12 changes: 1 addition & 11 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
const [isBannerVisible, setIsBannerVisible] = useState(true);
const [scrollPosition, setScrollPosition] = useState<ScrollPosition>({});

const wasReportAccessibleRef = useRef(false);

const [isComposerFocus, setIsComposerFocus] = useState(false);
const shouldAdjustScrollView = useMemo(() => isComposerFocus && !modal?.willAlertModalBecomeVisible, [isComposerFocus, modal]);
const viewportOffsetTop = useViewportOffsetTop(shouldAdjustScrollView);
Expand Down Expand Up @@ -324,14 +322,6 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
hideEmojiPicker(true);
}, [prevIsFocused, isFocused]);

useEffect(() => {
if (!report?.reportID) {
wasReportAccessibleRef.current = false;
return;
}
wasReportAccessibleRef.current = true;
}, [report]);

const backTo = route?.params?.backTo as string;
const onBackButtonPress = useCallback(() => {
if (backTo === SCREENS.SEARCH.REPORT_RHP) {
Expand Down Expand Up @@ -450,7 +440,7 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
}

// eslint-disable-next-line react-compiler/react-compiler
if (!wasReportAccessibleRef.current && !firstRenderRef.current && !reportID && !isOptimisticDelete && !reportMetadata?.isLoadingInitialReportActions && !userLeavingStatus) {
if (!firstRenderRef.current && !reportID && !isOptimisticDelete && !reportMetadata?.isLoadingInitialReportActions && !userLeavingStatus) {
// eslint-disable-next-line react-compiler/react-compiler
return true;
}
Expand Down
Loading