diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index daeb4e45fd39..ddff1f15c38f 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -429,12 +429,13 @@ function ReportScreen({ // If a user has chosen to leave a thread, and then returns to it (e.g. with the back button), we need to call `openReport` again in order to allow the user to rejoin and to receive real-time updates useEffect(() => { - if (!isFocused || prevIsFocused || !ReportUtils.isChatThread(report) || report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) { + if (!isSmallScreenWidth || !isFocused || prevIsFocused || !ReportUtils.isChatThread(report) || report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) { return; } Report.openReport(report.reportID); // We don't want to run this useEffect every time `report` is changed + // Excluding isSmallScreenWidth from the dependency list to prevent re-triggering on screen resize events. // eslint-disable-next-line react-hooks/exhaustive-deps }, [prevIsFocused, report.notificationPreference, isFocused]);