Skip to content

Commit

Permalink
minor fix.
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
  • Loading branch information
Krishna2323 committed Jul 4, 2024
1 parent bc1720f commit aa99fcd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1091,8 +1091,8 @@ function getCategoryOptionTree(options: Record<string, Category> | Category[], i
const indents = times(index, () => CONST.INDENTS).join('');
const isChild = array.length - 1 === index;
const searchText = array.slice(0, index + 1).join(CONST.PARENT_CHILD_SEPARATOR);
const parentOption = !isChild && Object.values(selectedOptions).find((op) => op.name === searchText);
const isParentOptionDisabled = !parentOption || !parentOption.enabled || parentOption.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;
const selectedParentOption = !isChild && Object.values(selectedOptions).find((op) => op.name === searchText);
const isParentOptionDisabled = !selectedParentOption || !selectedParentOption.enabled || selectedParentOption.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;

if (optionCollection.has(searchText)) {
return;
Expand All @@ -1104,7 +1104,7 @@ function getCategoryOptionTree(options: Record<string, Category> | Category[], i
searchText,
tooltipText: optionName,
isDisabled: isChild ? !option.enabled || option.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE : isParentOptionDisabled,
isSelected: isChild ? !!option.isSelected : !!selectedOptions.find((selectedOption) => selectedOption.name === searchText),
isSelected: isChild ? !!option.isSelected : !!selectedParentOption,
pendingAction: option.pendingAction,
});
});
Expand Down

0 comments on commit aa99fcd

Please sign in to comment.