chore: use `undefined` instead of `UNKNOWN_ID`

pull/102/head
boojack 3 years ago
parent 2fe2b82809
commit 5dd6d505cc

@ -108,7 +108,7 @@ const Memo: React.FC<Props> = (props: Props) => {
const tagName = targetEl.innerText.slice(1); const tagName = targetEl.innerText.slice(1);
const currTagQuery = locationService.getState().query?.tag; const currTagQuery = locationService.getState().query?.tag;
if (currTagQuery === tagName) { if (currTagQuery === tagName) {
locationService.setTagQuery(""); locationService.setTagQuery(undefined);
} else { } else {
locationService.setTagQuery(tagName); locationService.setTagQuery(tagName);
} }

@ -63,7 +63,7 @@ const ShortcutContainer: React.FC<ShortcutContainerProps> = (props: ShortcutCont
const handleShortcutClick = () => { const handleShortcutClick = () => {
if (isActive) { if (isActive) {
locationService.setMemoShortcut(UNKNOWN_ID); locationService.setMemoShortcut(undefined);
} else { } else {
if (!["/"].includes(locationService.getState().pathname)) { if (!["/"].includes(locationService.getState().pathname)) {
locationService.setPathname("/"); locationService.setPathname("/");

@ -94,7 +94,7 @@ const TagItemContainer: React.FC<TagItemContainerProps> = (props: TagItemContain
const handleTagClick = () => { const handleTagClick = () => {
if (isActive) { if (isActive) {
locationService.setTagQuery(""); locationService.setTagQuery(undefined);
} else { } else {
utils.copyTextToClipboard(`#${tag.text} `); utils.copyTextToClipboard(`#${tag.text} `);
if (!["/"].includes(locationService.getState().pathname)) { if (!["/"].includes(locationService.getState().pathname)) {

Loading…
Cancel
Save