mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-26 11:43:59 -05:00
feat: sort tags alphabetically (#1818)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
e671aa4aa8
commit
566b3009b6
1 changed files with 4 additions and 1 deletions
|
@ -20,7 +20,10 @@ export const TagSelectionInput: React.FC = () => {
|
||||||
const historyEntries = useApplicationState((state) => state.history)
|
const historyEntries = useApplicationState((state) => state.history)
|
||||||
|
|
||||||
const tags = useMemo<string[]>(() => {
|
const tags = useMemo<string[]>(() => {
|
||||||
const allTags = historyEntries.map((entry) => entry.tags).flat()
|
const allTags = historyEntries
|
||||||
|
.map((entry) => entry.tags)
|
||||||
|
.flat()
|
||||||
|
.sort((first, second) => first.toLowerCase().localeCompare(second.toLowerCase()))
|
||||||
return Array.from(new Set(allTags))
|
return Array.from(new Set(allTags))
|
||||||
}, [historyEntries])
|
}, [historyEntries])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue