Skip to content

Commit

Permalink
Merge pull request #40315 from rayane-djouah/Update-thread-headers-an…
Browse files Browse the repository at this point in the history
…cestry-to-deep-link-back-to-the-original-comment

[CP Staging] Fix: iOS - Thread - Unable to send a message after returning from thread - ParentNavigationSubtitle - Update navigation method to go back instead of navigate

(cherry picked from commit 5c43aa5)
  • Loading branch information
mountiny authored and OSBotify committed Apr 17, 2024
1 parent 093a5b2 commit 0148120
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/components/ParentNavigationSubtitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ function ParentNavigationSubtitle({parentNavigationSubtitleData, parentReportAct
onPress={() => {
const parentAction = ReportActionsUtils.getReportAction(parentReportID, parentReportActionID ?? '');
const isVisibleAction = ReportActionsUtils.shouldReportActionBeVisible(parentAction, parentAction?.reportActionID ?? '');
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, isVisibleAction && !isOffline ? parentReportActionID : undefined));
// Pop the thread report screen before navigating to the chat report.
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID));
if (isVisibleAction && !isOffline) {
// Pop the chat report screen before navigating to the linked report action.
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));
}
}}
accessibilityLabel={translate('threads.parentNavigationSummary', {reportName, workspaceName})}
role={CONST.ROLE.LINK}
Expand Down
9 changes: 6 additions & 3 deletions src/pages/home/report/ReportActionItemParentAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ function ReportActionItemParentAction({
<ReportActionItem
onPress={() => {
const isVisibleAction = ReportActionsUtils.shouldReportActionBeVisible(ancestor.reportAction, ancestor.reportAction.reportActionID ?? '');
Navigation.goBack(
ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? '', isVisibleAction && !isOffline ? ancestor.reportAction.reportActionID : undefined),
);
// Pop the thread report screen before navigating to the chat report.
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? ''));
if (isVisibleAction && !isOffline) {
// Pop the chat report screen before navigating to the linked report action.
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? '', ancestor.reportAction.reportActionID));
}
}}
parentReportAction={parentReportAction}
report={ancestor.report}
Expand Down
7 changes: 6 additions & 1 deletion src/pages/home/report/ThreadDivider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ function ThreadDivider({ancestor}: ThreadDividerProps) {
<PressableWithoutFeedback
onPress={() => {
const isVisibleAction = ReportActionsUtils.shouldReportActionBeVisible(ancestor.reportAction, ancestor.reportAction.reportActionID ?? '');
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? '', isVisibleAction && !isOffline ? ancestor.reportAction.reportActionID : undefined));
// Pop the thread report screen before navigating to the chat report.
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? ''));
if (isVisibleAction && !isOffline) {
// Pop the chat report screen before navigating to the linked report action.
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? '', ancestor.reportAction.reportActionID));
}
}}
accessibilityLabel={translate('threads.thread')}
role={CONST.ROLE.BUTTON}
Expand Down

0 comments on commit 0148120

Please sign in to comment.