From f59b181e1687a81bd33ba504dba3521aef57116a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Fri, 10 Nov 2023 12:55:16 -0600 Subject: [PATCH] Add Session check for TaskHeaderActionButton onPress. --- src/components/TaskHeaderActionButton.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/TaskHeaderActionButton.js b/src/components/TaskHeaderActionButton.js index b5dbe49fdd8d..c9c400193432 100644 --- a/src/components/TaskHeaderActionButton.js +++ b/src/components/TaskHeaderActionButton.js @@ -6,6 +6,7 @@ import compose from '@libs/compose'; import * as ReportUtils from '@libs/ReportUtils'; import reportPropTypes from '@pages/reportPropTypes'; import styles from '@styles/styles'; +import * as Session from '@userActions/Session'; import * as Task from '@userActions/Task'; import ONYXKEYS from '@src/ONYXKEYS'; import Button from './Button'; @@ -37,7 +38,7 @@ function TaskHeaderActionButton(props) { isDisabled={!Task.canModifyTask(props.report, props.session.accountID)} medium text={props.translate(ReportUtils.isCompletedTaskReport(props.report) ? 'task.markAsIncomplete' : 'task.markAsComplete')} - onPress={() => (ReportUtils.isCompletedTaskReport(props.report) ? Task.reopenTask(props.report) : Task.completeTask(props.report))} + onPress={Session.checkIfActionIsAllowed(() => (ReportUtils.isCompletedTaskReport(props.report) ? Task.reopenTask(props.report) : Task.completeTask(props.report)))} style={[styles.flex1]} />