Skip to content

Commit

Permalink
use correct state variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
s77rt committed May 12, 2024
1 parent d72c619 commit 8935e0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/pages/workspace/tags/WorkspaceTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
const theme = useTheme();
const {translate} = useLocalize();
const [selectedTags, setSelectedTags] = useState<Record<string, boolean>>({});
const [deleteTagsConfirmModalVisible, setDeleteTagsConfirmModalVisible] = useState(false);
const [isDeleteTagsConfirmModalVisible, setIsDeleteTagsConfirmModalVisible] = useState(false);
const isFocused = useIsFocused();
const policyID = route.params.policyID ?? '';
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`);
Expand Down Expand Up @@ -159,7 +159,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
const deleteTags = () => {
setSelectedTags({});
Policy.deletePolicyTags(policyID, selectedTagsArray);
setDeleteTagsConfirmModalVisible(false);
setIsDeleteTagsConfirmModalVisible(false);
};

const isLoading = !isOffline && policyTags === undefined;
Expand Down Expand Up @@ -201,7 +201,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
icon: Expensicons.Trashcan,
text: translate(selectedTagsArray.length === 1 ? 'workspace.tags.deleteTag' : 'workspace.tags.deleteTags'),
value: CONST.POLICY.TAGS_BULK_ACTION_TYPES.DELETE,
onSelected: () => setDeleteTagsConfirmModalVisible(true),
onSelected: () => setIsDeleteTagsConfirmModalVisible(true),
});
}

Expand Down Expand Up @@ -284,9 +284,9 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
{!isSmallScreenWidth && getHeaderButtons()}
</HeaderWithBackButton>
<ConfirmModal
isVisible={deleteTagsConfirmModalVisible}
isVisible={isDeleteTagsConfirmModalVisible}
onConfirm={deleteTags}
onCancel={() => setDeleteTagsConfirmModalVisible(false)}
onCancel={() => setIsDeleteTagsConfirmModalVisible(false)}
title={translate(selectedTagsArray.length === 1 ? 'workspace.tags.deleteTag' : 'workspace.tags.deleteTags')}
prompt={translate(selectedTagsArray.length === 1 ? 'workspace.tags.deleteTagConfirmation' : 'workspace.tags.deleteTagsConfirmation')}
confirmText={translate('common.delete')}
Expand Down
10 changes: 5 additions & 5 deletions src/pages/workspace/tags/WorkspaceViewTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function WorkspaceViewTagsPage({route}: WorkspaceViewTagsProps) {
const {translate} = useLocalize();
const [selectedTags, setSelectedTags] = useState<Record<string, boolean>>({});
const dropdownButtonRef = useRef(null);
const [deleteTagsConfirmModalVisible, setDeleteTagsConfirmModalVisible] = useState(false);
const [isDeleteTagsConfirmModalVisible, setIsDeleteTagsConfirmModalVisible] = useState(false);
const isFocused = useIsFocused();
const policyID = route.params.policyID ?? '';
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`);
Expand Down Expand Up @@ -125,7 +125,7 @@ function WorkspaceViewTagsPage({route}: WorkspaceViewTagsProps) {
const deleteTags = () => {
setSelectedTags({});
Policy.deletePolicyTags(policyID, selectedTagsArray);
setDeleteTagsConfirmModalVisible(false);
setIsDeleteTagsConfirmModalVisible(false);
};

const isLoading = !isOffline && policyTags === undefined;
Expand All @@ -143,7 +143,7 @@ function WorkspaceViewTagsPage({route}: WorkspaceViewTagsProps) {
icon: Expensicons.Trashcan,
text: translate(selectedTagsArray.length === 1 ? 'workspace.tags.deleteTag' : 'workspace.tags.deleteTags'),
value: CONST.POLICY.TAGS_BULK_ACTION_TYPES.DELETE,
onSelected: () => setDeleteTagsConfirmModalVisible(true),
onSelected: () => setIsDeleteTagsConfirmModalVisible(true),
});
}

Expand Down Expand Up @@ -223,9 +223,9 @@ function WorkspaceViewTagsPage({route}: WorkspaceViewTagsProps) {
>
<HeaderWithBackButton title={currentTagListName}>{getHeaderButtons()}</HeaderWithBackButton>
<ConfirmModal
isVisible={deleteTagsConfirmModalVisible}
isVisible={isDeleteTagsConfirmModalVisible}
onConfirm={deleteTags}
onCancel={() => setDeleteTagsConfirmModalVisible(false)}
onCancel={() => setIsDeleteTagsConfirmModalVisible(false)}
title={translate(selectedTagsArray.length === 1 ? 'workspace.tags.deleteTag' : 'workspace.tags.deleteTags')}
prompt={translate(selectedTagsArray.length === 1 ? 'workspace.tags.deleteTagConfirmation' : 'workspace.tags.deleteTagsConfirmation')}
confirmText={translate('common.delete')}
Expand Down

0 comments on commit 8935e0a

Please sign in to comment.