feat: reset quick search
This commit is contained in:
@@ -22,17 +22,14 @@ const isMac = () => {
|
|||||||
return getUaHelper().isMacOs;
|
return getUaHelper().isMacOs;
|
||||||
};
|
};
|
||||||
export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
|
export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
|
||||||
const { currentWorkspaceId, workspaceList } = useAppState();
|
const { currentMetaWorkSpace } = useAppState();
|
||||||
|
|
||||||
const [query, setQuery] = useState('');
|
const [query, setQuery] = useState('');
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [showCreatePage, setShowCreatePage] = useState(true);
|
const [showCreatePage, setShowCreatePage] = useState(true);
|
||||||
const { triggerQuickSearchModal } = useModal();
|
const { triggerQuickSearchModal } = useModal();
|
||||||
|
|
||||||
const currentWorkspace = workspaceList.find(
|
const isPublish = currentMetaWorkSpace?.isPublish;
|
||||||
meta => String(meta.id) === String(currentWorkspaceId)
|
|
||||||
);
|
|
||||||
const isPublish = currentWorkspace?.isPublish;
|
|
||||||
|
|
||||||
// Add ‘⌘+K’ shortcut keys as switches
|
// Add ‘⌘+K’ shortcut keys as switches
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
import type { PropsWithChildren } from 'react';
|
import type { PropsWithChildren } from 'react';
|
||||||
import ShortcutsModal from '@/components/shortcuts-modal';
|
import ShortcutsModal from '@/components/shortcuts-modal';
|
||||||
import ContactModal from '@/components/contact-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 { ImportModal } from '@/components/import';
|
||||||
import { LoginModal } from '@/components/login-modal';
|
import { LoginModal } from '@/components/login-modal';
|
||||||
|
|
||||||
@@ -97,12 +97,12 @@ export const ModalProvider = ({
|
|||||||
triggerHandler('shortcuts', false);
|
triggerHandler('shortcuts', false);
|
||||||
}}
|
}}
|
||||||
></ShortcutsModal>
|
></ShortcutsModal>
|
||||||
{/*<QuickSearch*/}
|
<QuickSearch
|
||||||
{/* open={modalMap.quickSearch}*/}
|
open={modalMap.quickSearch}
|
||||||
{/* onClose={() => {*/}
|
onClose={() => {
|
||||||
{/* triggerHandler('quickSearch', false);*/}
|
triggerHandler('quickSearch', false);
|
||||||
{/* }}*/}
|
}}
|
||||||
{/*></QuickSearch>*/}
|
></QuickSearch>
|
||||||
<ImportModal
|
<ImportModal
|
||||||
open={modalMap.import}
|
open={modalMap.import}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user