From 5dd6d505cc36eae7b9cd9efaf9eda6696cbd7ff7 Mon Sep 17 00:00:00 2001 From: boojack Date: Sat, 2 Jul 2022 15:05:42 +0800 Subject: [PATCH] chore: use `undefined` instead of `UNKNOWN_ID` --- web/src/components/Memo.tsx | 2 +- web/src/components/ShortcutList.tsx | 2 +- web/src/components/TagList.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx index c1dd5acf..ac583912 100644 --- a/web/src/components/Memo.tsx +++ b/web/src/components/Memo.tsx @@ -108,7 +108,7 @@ const Memo: React.FC = (props: Props) => { const tagName = targetEl.innerText.slice(1); const currTagQuery = locationService.getState().query?.tag; if (currTagQuery === tagName) { - locationService.setTagQuery(""); + locationService.setTagQuery(undefined); } else { locationService.setTagQuery(tagName); } diff --git a/web/src/components/ShortcutList.tsx b/web/src/components/ShortcutList.tsx index e436b291..034a10fe 100644 --- a/web/src/components/ShortcutList.tsx +++ b/web/src/components/ShortcutList.tsx @@ -63,7 +63,7 @@ const ShortcutContainer: React.FC = (props: ShortcutCont const handleShortcutClick = () => { if (isActive) { - locationService.setMemoShortcut(UNKNOWN_ID); + locationService.setMemoShortcut(undefined); } else { if (!["/"].includes(locationService.getState().pathname)) { locationService.setPathname("/"); diff --git a/web/src/components/TagList.tsx b/web/src/components/TagList.tsx index 32506c44..66c3cddc 100644 --- a/web/src/components/TagList.tsx +++ b/web/src/components/TagList.tsx @@ -94,7 +94,7 @@ const TagItemContainer: React.FC = (props: TagItemContain const handleTagClick = () => { if (isActive) { - locationService.setTagQuery(""); + locationService.setTagQuery(undefined); } else { utils.copyTextToClipboard(`#${tag.text} `); if (!["/"].includes(locationService.getState().pathname)) {