fix: initial memo filter

This commit is contained in:
boojack 2022-05-22 17:40:32 +08:00
parent 6b538cd43d
commit 8887eecf07

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);