chore: optimize code

This commit is contained in:
JimmFly 2023-01-17 10:41:53 +08:00
parent d9ad8ee608
commit 21f9f87cb2

View File

@ -54,10 +54,7 @@ export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
}, [open, triggerQuickSearchModal]);
useEffect(() => {
if (
router.pathname === '/public-workspace/[workspaceId]/[pageId]' ||
router.pathname === '/public-workspace/[workspaceId]'
) {
if (router.pathname.startsWith('/public-workspace')) {
return setIsPublic(true);
} else {
return setIsPublic(false);