From 60b8a68d7e57543e6d18ff9a36a2031f6dab39f5 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 3 Jan 2024 11:00:29 +0700 Subject: [PATCH] disable checkbox of task preview if not visit the task report --- src/components/ReportActionItem/TaskPreview.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/TaskPreview.js b/src/components/ReportActionItem/TaskPreview.js index a7728045f407..414f030d4fc7 100644 --- a/src/components/ReportActionItem/TaskPreview.js +++ b/src/components/ReportActionItem/TaskPreview.js @@ -123,7 +123,10 @@ function TaskPreview(props) { style={[styles.mr2]} containerStyle={[styles.taskCheckbox]} isChecked={isTaskCompleted} - disabled={!Task.canModifyTask(props.taskReport, props.currentUserPersonalDetails.accountID, lodashGet(props.rootParentReportpolicy, 'role', ''))} + disabled={ + _.isEmpty(props.taskReport) || + !Task.canModifyTask(props.taskReport, props.currentUserPersonalDetails.accountID, lodashGet(props.rootParentReportpolicy, 'role', '')) + } onPress={Session.checkIfActionIsAllowed(() => { if (isTaskCompleted) { Task.reopenTask(props.taskReport);