Dedupe profile labels (#7833)

* dedupe labels

* apply to postalerts
This commit is contained in:
Samuel Newman
2025-02-24 14:17:59 -08:00
committed by GitHub
parent 61a14043e5
commit 6254cf020a
4 changed files with 18 additions and 7 deletions
+12
View File
@@ -137,3 +137,15 @@ export function useLabelSubject({label}: {label: ComAtprotoLabelDefs.Label}): {
}
}, [label])
}
export function unique(
value: ModerationCause,
index: number,
array: ModerationCause[],
) {
return (
array.findIndex(
item => getModerationCauseKey(item) === getModerationCauseKey(value),
) === index
)
}