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
fix(web): calendar navigation should use current page path (#5605)
MuLingQwQb5108b4f97b6
diff --git a/web/src/hooks/useDateFilterNavigation.ts b/web/src/hooks/useDateFilterNavigation.tsindex ce0a167b6..d04724da9 100644--- a/web/src/hooks/useDateFilterNavigation.ts+++ b/web/src/hooks/useDateFilterNavigation.ts@@ -1,16 +1,18 @@import { useCallback } from "react";-import { useNavigate } from "react-router-dom";+import { useLocation, useNavigate } from "react-router-dom";import { stringifyFilters } from "@/contexts/MemoFilterContext";-export const useDateFilterNavigation = () => {+export const useDateFilterNavigation = (targetPath?: string) => {const navigate = useNavigate();+ const location = useLocation();const navigateToDateFilter = useCallback((date: string) => {const filterQuery = stringifyFilters([{ factor: "displayTime", value: date }]);- navigate(`/?filter=${filterQuery}`);+ const basePath = targetPath ?? location.pathname;+ navigate(`${basePath}?filter=${filterQuery}`);},- [navigate],+ [navigate, location.pathname, targetPath],);return navigateToDateFilter;