Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
chore: update timeline filters
Steven08a929196436
diff --git a/web/src/pages/Timeline.tsx b/web/src/pages/Timeline.tsxindex ec3f520f1..aa813c775 100644--- a/web/src/pages/Timeline.tsx+++ b/web/src/pages/Timeline.tsx@@ -29,7 +29,7 @@ const Timeline = () => {const memoStore = useMemoStore();const memoList = useMemoList();const [, setLastVisited] = useLocalStorage<string>("lastVisited", Routes.TIMELINE);- const { tag: tagQuery, text: textQuery } = useFilterWithUrlParams();+ const filter = useFilterWithUrlParams();const [activityStats, setActivityStats] = useState<Record<string, number>>({});const [selectedDateString, setSelectedDateString] = useState<string>(new Date().toDateString());const [isRequesting, setIsRequesting] = useState(true);@@ -44,21 +44,11 @@ const Timeline = () => {useEffect(() => {memoList.reset();fetchMemos("");- }, [selectedDateString, tagQuery, textQuery]);+ }, [selectedDateString, filter.text, filter.tag, filter.memoPropertyFilter]);useEffect(() => {(async () => {const filters = [`row_status == "NORMAL"`];- const contentSearch: string[] = [];- if (textQuery) {- contentSearch.push(JSON.stringify(textQuery));- }- if (contentSearch.length > 0) {- filters.push(`content_search == [${contentSearch.join(", ")}]`);- }- if (tagQuery) {- filters.push(`tag == "${tagQuery}"`);- }const { stats } = await memoServiceClient.getUserMemosStats({name: user.name,timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,@@ -79,14 +69,25 @@ const Timeline = () => {setIsRequesting(true);const filters = [`creator == "${user.name}"`, `row_status == "NORMAL"`];const contentSearch: string[] = [];- if (textQuery) {- contentSearch.push(JSON.stringify(textQuery));+ if (filter.text) {+ contentSearch.push(JSON.stringify(filter.text));}if (contentSearch.length > 0) {filters.push(`content_search == [${contentSearch.join(", ")}]`);}- if (tagQuery) {- filters.push(`tag == "${tagQuery}"`);+ if (filter.tag) {+ filters.push(`tag == "${filter.tag}"`);+ }+ if (filter.memoPropertyFilter) {+ if (filter.memoPropertyFilter.hasLink) {+ filters.push(`has_link == true`);+ }+ if (filter.memoPropertyFilter.hasTaskList) {+ filters.push(`has_task_list == true`);+ }+ if (filter.memoPropertyFilter.hasCode) {+ filters.push(`has_code == true`);+ }}if (selectedDateString) {const selectedDateStamp = getTimeStampByDate(selectedDateString);