fix: initial memo filter

This commit is contained in:
boojack
2022-05-22 17:40:32 +08:00
parent 069c5d6a35
commit d23262856e

View File

@@ -8,7 +8,8 @@ interface FilterProps {}
const MemoFilter: React.FC<FilterProps> = () => {
const query = useAppSelector((state) => state.location.query);
const { tag: tagQuery, duration, type: memoType, text: textQuery, shortcutId } = query ?? {};
useAppSelector((state) => state.shortcut.shortcuts);
const { tag: tagQuery, duration, type: memoType, text: textQuery, shortcutId } = query;
const shortcut = shortcutId ? shortcutService.getShortcutById(shortcutId) : null;
const showFilter = Boolean(tagQuery || (duration && duration.from < duration.to) || memoType || textQuery || shortcut);