Skip to content

Commit

Permalink
adjust all selected
Browse files Browse the repository at this point in the history
  • Loading branch information
cretadn22 committed Aug 21, 2024
1 parent ccc4f56 commit b3f00c7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ function ReportFieldsListValuesPage({
};

const toggleAllValues = () => {
const isAllSelected = listValues.length === Object.keys(selectedValues).length;
const areAllSelected = listValues.length === selectedValuesArray.length;

setSelectedValues(isAllSelected ? {} : Object.fromEntries(listValues.map((value) => [value, true])));
setSelectedValues(areAllSelected ? {} : Object.fromEntries(listValues.map((value) => [value, true])));
};

const handleDeleteValues = () => {
Expand Down Expand Up @@ -176,7 +176,7 @@ function ReportFieldsListValuesPage({

const getHeaderButtons = () => {
const options: Array<DropdownOption<DeepValueOf<typeof CONST.POLICY.BULK_ACTION_TYPES>>> = [];
if ((isSmallScreenWidth ? selectionMode?.isEnabled : true) && selectedValuesArray.length > 0) {
if (isSmallScreenWidth ? selectionMode?.isEnabled : selectedValuesArray.length > 0) {
if (selectedValuesArray.length > 0) {
options.push({
icon: Expensicons.Trashcan,
Expand Down

0 comments on commit b3f00c7

Please sign in to comment.