From 871fa8f4a434d9c3dffcd0ea14bfd0487a065bf0 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 25 Dec 2023 16:17:37 +0700 Subject: [PATCH] fix: get parrent report policy when open task --- src/pages/tasks/TaskAssigneeSelectorModal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/tasks/TaskAssigneeSelectorModal.js b/src/pages/tasks/TaskAssigneeSelectorModal.js index 8ef9bf1414f7..39b585438413 100644 --- a/src/pages/tasks/TaskAssigneeSelectorModal.js +++ b/src/pages/tasks/TaskAssigneeSelectorModal.js @@ -263,8 +263,11 @@ export default compose( session: { key: ONYXKEYS.SESSION, }, + }), + withOnyx({ rootParentReportPolicy: { - key: ({report}) => { + key: ({reports, route}) => { + const report = reports[`${ONYXKEYS.COLLECTION.REPORT}${route.params?.reportID || '0'}`]; const rootParentReport = ReportUtils.getRootParentReport(report); return `${ONYXKEYS.COLLECTION.POLICY}${rootParentReport ? rootParentReport.policyID : '0'}`; },