feat: reset quick search

This commit is contained in:
QiShaoXuan 2023-01-10 15:43:21 +08:00
parent 64e90640b9
commit 469931a61f
2 changed files with 9 additions and 12 deletions

View File

@ -22,17 +22,14 @@ const isMac = () => {
return getUaHelper().isMacOs;
};
export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
const { currentWorkspaceId, workspaceList } = useAppState();
const { currentMetaWorkSpace } = useAppState();
const [query, setQuery] = useState('');
const [loading, setLoading] = useState(true);
const [showCreatePage, setShowCreatePage] = useState(true);
const { triggerQuickSearchModal } = useModal();
const currentWorkspace = workspaceList.find(
meta => String(meta.id) === String(currentWorkspaceId)
);
const isPublish = currentWorkspace?.isPublish;
const isPublish = currentMetaWorkSpace?.isPublish;
// Add ‘⌘+K shortcut keys as switches
useEffect(() => {

View File

@ -9,7 +9,7 @@ import {
import type { PropsWithChildren } from 'react';
import ShortcutsModal from '@/components/shortcuts-modal';
import ContactModal from '@/components/contact-modal';
// import QuickSearch from '@/components/quick-search';
import QuickSearch from '@/components/quick-search';
import { ImportModal } from '@/components/import';
import { LoginModal } from '@/components/login-modal';
@ -97,12 +97,12 @@ export const ModalProvider = ({
triggerHandler('shortcuts', false);
}}
></ShortcutsModal>
{/*<QuickSearch*/}
{/* open={modalMap.quickSearch}*/}
{/* onClose={() => {*/}
{/* triggerHandler('quickSearch', false);*/}
{/* }}*/}
{/*></QuickSearch>*/}
<QuickSearch
open={modalMap.quickSearch}
onClose={() => {
triggerHandler('quickSearch', false);
}}
></QuickSearch>
<ImportModal
open={modalMap.import}
onClose={() => {