Skip to content

Commit

Permalink
Move isControlPolicy inside if
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejkustra committed Sep 17, 2024
1 parent 8f4984b commit 6674af6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/pages/workspace/categories/ImportedCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ function ImportedCategoriesPage({route}: ImportedCategoriesPageProps) {
const policy = usePolicy(policyID);
const columnNames = generateColumnNames(spreadsheet?.data?.length ?? 0);

const isControl = isControlPolicy(policy);

const getColumnRoles = (): ColumnRole[] => {
const roles = [];
roles.push(
Expand All @@ -42,7 +40,7 @@ function ImportedCategoriesPage({route}: ImportedCategoriesPageProps) {
{text: translate('common.enabled'), value: CONST.CSV_IMPORT_COLUMNS.ENABLED, isRequired: true},
);

if (isControl) {
if (isControlPolicy(policy)) {
roles.push({text: translate('workspace.categories.glCode'), value: CONST.CSV_IMPORT_COLUMNS.GL_CODE});
}

Expand Down
4 changes: 1 addition & 3 deletions src/pages/workspace/tags/ImportedTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ function ImportedTagsPage({route}: ImportedTagsPageProps) {
const policy = usePolicy(policyID);
const columnNames = generateColumnNames(spreadsheet?.data?.length ?? 0);

const isControl = isControlPolicy(policy);

const getColumnRoles = (): ColumnRole[] => {
const roles = [];
roles.push(
Expand All @@ -45,7 +43,7 @@ function ImportedTagsPage({route}: ImportedTagsPageProps) {
{text: translate('common.enabled'), value: CONST.CSV_IMPORT_COLUMNS.ENABLED, isRequired: true},
);

if (isControl) {
if (isControlPolicy(policy)) {
roles.push({text: translate('workspace.tags.glCode'), value: CONST.CSV_IMPORT_COLUMNS.GL_CODE});
}

Expand Down

0 comments on commit 6674af6

Please sign in to comment.