From c8baeb86ec610a8da5c6ac1289d472281fe5f639 Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 30 Mar 2024 13:04:40 +0800 Subject: [PATCH] chore: fix memo links --- web/src/components/MemoActionMenu.tsx | 2 +- .../components/MemoContent/ReferencedContent/ReferencedMemo.tsx | 2 +- web/src/components/MemoView.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index 788b60bc..bf414960 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -24,7 +24,7 @@ const MemoActionMenu = (props: Props) => { const location = useLocation(); const navigateTo = useNavigateTo(); const memoStore = useMemoStore(); - const isInMemoDetailPage = location.pathname.startsWith(`/m/${memo.name}`); + const isInMemoDetailPage = location.pathname.startsWith(`/m/${memo.uid}`); const handleTogglePinMemoBtnClick = async () => { try { diff --git a/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx b/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx index 57b98a8a..e9dd6668 100644 --- a/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx +++ b/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx @@ -31,7 +31,7 @@ const ReferencedMemo = ({ resourceId, params: paramsStr }: Props) => { const displayContent = paramsText || (memo.content.length > 12 ? `${memo.content.slice(0, 12)}...` : memo.content); const handleGotoMemoDetailPage = () => { - navigateTo(`/m/${memo.name}`); + navigateTo(`/m/${memo.uid}`); }; return ( diff --git a/web/src/components/MemoView.tsx b/web/src/components/MemoView.tsx index c8eeb5a8..6954022e 100644 --- a/web/src/components/MemoView.tsx +++ b/web/src/components/MemoView.tsx @@ -45,7 +45,7 @@ const MemoView: React.FC = (props: Props) => { ).length; const relativeTimeFormat = Date.now() - memo.displayTime!.getTime() > 1000 * 60 * 60 * 24 ? "datetime" : "auto"; const readonly = memo.creator !== user?.name; - const isInMemoDetailPage = location.pathname.startsWith(`/m/${memo.name}`); + const isInMemoDetailPage = location.pathname.startsWith(`/m/${memo.uid}`); // Initial related data: creator. useEffect(() => {