From 197dcc3acf5823e3c8eb470aa4f24e07238b0bca Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 6 Oct 2023 20:19:50 +0700 Subject: [PATCH 1/3] fix: 28969 --- src/pages/home/ReportScreen.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 78f6edcf7dd3..c13858d1ff05 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -39,6 +39,7 @@ import DragAndDropProvider from '../../components/DragAndDrop/Provider'; import usePrevious from '../../hooks/usePrevious'; import CONST from '../../CONST'; import withCurrentReportID, {withCurrentReportIDPropTypes, withCurrentReportIDDefaultProps} from '../../components/withCurrentReportID'; +import useNetwork from '../../hooks/useNetwork'; const propTypes = { /** Navigation route context info provided by react navigation */ @@ -156,6 +157,7 @@ function ReportScreen({ const prevReport = usePrevious(report); const prevUserLeavingStatus = usePrevious(userLeavingStatus); const [isBannerVisible, setIsBannerVisible] = useState(true); + const {isOffline} = useNetwork(); const reportID = getReportID(route); const {addWorkspaceRoomOrChatPendingAction, addWorkspaceRoomOrChatErrors} = ReportUtils.getReportOfflinePendingActionAndErrors(report); @@ -362,8 +364,8 @@ function ReportScreen({ // eslint-disable-next-line rulesdir/no-negated-variables const shouldShowNotFoundPage = useMemo( - () => (!firstRenderRef.current && !report.reportID && !isOptimisticDelete && !reportMetadata.isLoadingReportActions && !isLoading && !userLeavingStatus) || shouldHideReport, - [report, reportMetadata, isLoading, shouldHideReport, isOptimisticDelete, userLeavingStatus], + () => (!firstRenderRef.current && !report.reportID && (isOffline || (!reportMetadata.isLoadingReportActions && !isOptimisticDelete)) && !isLoading && !userLeavingStatus) || shouldHideReport, + [report, reportMetadata, isLoading, shouldHideReport, isOptimisticDelete, userLeavingStatus, isOffline], ); return ( From 001aae314b7d0185f2fac914196ae77e853ba8ad Mon Sep 17 00:00:00 2001 From: tienifr Date: Thu, 30 Nov 2023 23:31:53 +0700 Subject: [PATCH 2/3] fix: Undefined displayed in header offline when opening left thread --- src/libs/actions/Report.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index a03488429405..852a11f93db6 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -2053,6 +2053,9 @@ function leaveRoom(reportID, isWorkspaceMemberLeavingWorkspaceRoom = false) { value: { stateNum: CONST.REPORT.STATE_NUM.SUBMITTED, statusNum: CONST.REPORT.STATUS.CLOSED, + parentReportID: report.parentReportID, + parentReportActionID: report.parentReportActionID, + type: report.type, }, }, ]; From baf668f1f54ee128323aa1364dda36bc8f5f4cb5 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 1 Dec 2023 17:53:55 +0700 Subject: [PATCH 3/3] fix avatar for workspace thread --- src/libs/ReportUtils.ts | 2 +- src/libs/actions/Report.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index f6c3090143f4..666d90aac21e 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3849,7 +3849,7 @@ function getWhisperDisplayNames(participantAccountIDs?: number[]): string | unde * Show subscript on workspace chats / threads and expense requests */ function shouldReportShowSubscript(report: OnyxEntry): boolean { - if (isArchivedRoom(report)) { + if (isArchivedRoom(report) && !isWorkspaceThread(report)) { return false; } diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 852a11f93db6..c2cfa1ac92a2 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -2053,8 +2053,10 @@ function leaveRoom(reportID, isWorkspaceMemberLeavingWorkspaceRoom = false) { value: { stateNum: CONST.REPORT.STATE_NUM.SUBMITTED, statusNum: CONST.REPORT.STATUS.CLOSED, + chatType: report.chatType, parentReportID: report.parentReportID, parentReportActionID: report.parentReportActionID, + policyID: report.policyID, type: report.type, }, },