fix: sort tags in creating shortcut (#69)

This commit is contained in:
STEVEN 2022-05-24 18:07:46 +08:00 committed by GitHub
parent 7b6be96eb3
commit 5d6df87af0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,6 +152,7 @@ interface MemoFilterInputerProps {
const FilterInputer: React.FC<MemoFilterInputerProps> = (props: MemoFilterInputerProps) => {
const { index, filter, handleFilterChange, handleFilterRemove } = props;
const tags = Array.from(memoService.getState().tags);
const { type } = filter;
const [inputElements, setInputElements] = useState<JSX.Element>(<></>);
@ -185,12 +186,9 @@ const FilterInputer: React.FC<MemoFilterInputerProps> = (props: MemoFilterInpute
valueElement = (
<Selector
className="value-selector"
dataSource={memoService
.getState()
.tags.sort()
.map((t) => {
return { text: t, value: t };
})}
dataSource={tags.sort().map((t) => {
return { text: t, value: t };
})}
value={filter.value.value}
handleValueChanged={handleValueChange}
/>