Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanDylann committed Dec 8, 2023
1 parent de9e6d4 commit 5901627
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/TaskHeaderActionButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import lodashGet from 'lodash/get';
import {get} from 'lodash';

Check failure on line 1 in src/components/TaskHeaderActionButton.tsx

View workflow job for this annotation

GitHub Actions / lint

Import { get } from 'lodash' detected. Consider using the native optional chaining to get nested values and nullish coalescing operator for fallback values
import React from 'react';
import {View} from 'react-native';
import {OnyxEntry, withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import useLocalize from '@hooks/useLocalize';
import * as ReportUtils from '@libs/ReportUtils';
import useThemeStyles from '@styles/useThemeStyles';
Expand Down Expand Up @@ -33,7 +32,7 @@ function TaskHeaderActionButton({report, session, policy}: TaskHeaderActionButto
<View style={[styles.flexRow, styles.alignItemsCenter, styles.justifyContentEnd]}>
<Button
success
isDisabled={!Task.canModifyTask(report, session?.accountID ?? 0, lodashGet(policy, 'role', ''))}
isDisabled={!Task.canModifyTask(report, session?.accountID ?? 0, get(policy, 'role', ''))}
medium
text={translate(ReportUtils.isCompletedTaskReport(report) ? 'task.markAsIncomplete' : 'task.markAsComplete')}
onPress={Session.checkIfActionIsAllowed(() => (ReportUtils.isCompletedTaskReport(report) ? Task.reopenTask(report) : Task.completeTask(report)))}
Expand Down

0 comments on commit 5901627

Please sign in to comment.