Skip to content

Commit

Permalink
feat: remove invalid labels if any in the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
tthvo committed Aug 10, 2024
1 parent a89060f commit e44974e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/RecordingMetadata/RecordingLabelFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ export const RecordingLabelFields: React.FC<RecordingLabelFieldsProps> = ({
const handleLabelEdit = React.useCallback(
(idx: number, keyValue: string) => {
const label = getLabelFromInput(keyValue);
const updatedLabels = [...labels];
if (label) {
const updatedLabels = [...labels];
updatedLabels[idx] = label;
setLabels(updatedLabels);
} else {
updatedLabels.splice(idx);
}
setLabels(updatedLabels);
},
[labels, setLabels],
);
Expand Down Expand Up @@ -188,7 +190,7 @@ export const RecordingLabelFields: React.FC<RecordingLabelFieldsProps> = ({
)}
<LabelGroup
categoryName="Recording Labels"
numLabels={5}
numLabels={10}
isEditable
addLabelControl={
<Label color="blue" variant="outline" isDisabled={isDisabled} onClick={handleAddLabelButtonClick}>
Expand Down

0 comments on commit e44974e

Please sign in to comment.