Skip to content

Commit

Permalink
disable checkbox of task preview if not visit the task report
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Jan 3, 2024
1 parent 5049f8c commit 60b8a68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/ReportActionItem/TaskPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 60b8a68

Please sign in to comment.