mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: visibility click filter (#463)
* feat: visibility click filter * update Co-authored-by: boojack <stevenlgtm@gmail.com>
This commit is contained in:
@ -17,9 +17,9 @@ const MemoList = () => {
|
||||
const { memos, isFetching } = useAppSelector((state) => state.memo);
|
||||
const [isComplete, setIsComplete] = useState<boolean>(false);
|
||||
|
||||
const { tag: tagQuery, duration, type: memoType, text: textQuery, shortcutId } = query ?? {};
|
||||
const { tag: tagQuery, duration, type: memoType, text: textQuery, shortcutId, visibility } = query ?? {};
|
||||
const shortcut = shortcutId ? shortcutService.getShortcutById(shortcutId) : null;
|
||||
const showMemoFilter = Boolean(tagQuery || (duration && duration.from < duration.to) || memoType || textQuery || shortcut);
|
||||
const showMemoFilter = Boolean(tagQuery || (duration && duration.from < duration.to) || memoType || textQuery || shortcut || visibility);
|
||||
|
||||
const shownMemos =
|
||||
showMemoFilter || shortcut
|
||||
@ -65,6 +65,9 @@ const MemoList = () => {
|
||||
if (textQuery && !memo.content.toLowerCase().includes(textQuery.toLowerCase())) {
|
||||
shouldShow = false;
|
||||
}
|
||||
if (visibility) {
|
||||
shouldShow = memo.visibility === visibility;
|
||||
}
|
||||
|
||||
return shouldShow;
|
||||
})
|
||||
|
Reference in New Issue
Block a user