hailey/filter dupe labels (#5984)
This commit is contained in:
@@ -34,13 +34,17 @@ export function LabelsBtn({
|
||||
const updateAdultLabels = (newLabels: AdultSelfLabel[]) => {
|
||||
const newLabel = newLabels[newLabels.length - 1]
|
||||
const filtered = labels.filter(l => !ADULT_CONTENT_LABELS.includes(l))
|
||||
onChange([...filtered, newLabel].filter(Boolean) as SelfLabel[])
|
||||
onChange([
|
||||
...new Set([...filtered, newLabel].filter(Boolean) as SelfLabel[]),
|
||||
])
|
||||
}
|
||||
|
||||
const updateOtherLabels = (newLabels: OtherSelfLabel[]) => {
|
||||
const newLabel = newLabels[newLabels.length - 1]
|
||||
const filtered = labels.filter(l => !OTHER_SELF_LABELS.includes(l))
|
||||
onChange([...filtered, newLabel].filter(Boolean) as SelfLabel[])
|
||||
onChange([
|
||||
...new Set([...filtered, newLabel].filter(Boolean) as SelfLabel[]),
|
||||
])
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user