From f1df0f4f67c167de79287c0c61fa9f319cc89430 Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 18 Sep 2023 16:09:48 +0700 Subject: [PATCH] fix: flag comment page not show not found when delete thread first message --- src/pages/FlagCommentPage.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pages/FlagCommentPage.js b/src/pages/FlagCommentPage.js index 0b850e6c384..1a9a2d8c876 100644 --- a/src/pages/FlagCommentPage.js +++ b/src/pages/FlagCommentPage.js @@ -2,6 +2,7 @@ import React, {useCallback} from 'react'; import _ from 'underscore'; import {View, ScrollView} from 'react-native'; import PropTypes from 'prop-types'; +import {withOnyx} from 'react-native-onyx'; import reportPropTypes from './reportPropTypes'; import reportActionPropTypes from './home/report/reportActionPropTypes'; import withLocalize, {withLocalizePropTypes} from '../components/withLocalize'; @@ -20,6 +21,7 @@ import * as ReportActionsUtils from '../libs/ReportActionsUtils'; import * as Session from '../libs/actions/Session'; import FullPageNotFoundView from '../components/BlockingViews/FullPageNotFoundView'; import withReportAndReportActionOrNotFound from './home/report/withReportAndReportActionOrNotFound'; +import ONYXKEYS from '../ONYXKEYS'; const propTypes = { /** Array of report actions for this report */ @@ -178,4 +180,13 @@ FlagCommentPage.propTypes = propTypes; FlagCommentPage.defaultProps = defaultProps; FlagCommentPage.displayName = 'FlagCommentPage'; -export default compose(withLocalize, withReportAndReportActionOrNotFound)(FlagCommentPage); +export default compose( + withLocalize, + withReportAndReportActionOrNotFound, + withOnyx({ + parentReportActions: { + key: ({report}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID || report.reportID}`, + canEvict: false, + }, + }), +)(FlagCommentPage);