Disable command palette

It's a good supporting featured, but it was not made with virtual
branches in mind. In it's current state it only introduces confusions,
and it's probably not functioning correctly.
This commit is contained in:
Kiril Videlov 2023-06-28 10:11:40 +02:00 committed by Kiril Videlov
parent 5c1f92b44b
commit 7fbfc7de20

View File

@ -4,7 +4,7 @@
import { open } from '@tauri-apps/api/dialog'; import { open } from '@tauri-apps/api/dialog';
import { toasts, Toaster, events, hotkeys, stores } from '$lib'; import { toasts, Toaster, events, hotkeys, stores } from '$lib';
import type { LayoutData } from './$types'; import type { LayoutData } from './$types';
import { Link, CommandPalette } from '$lib/components'; import { Link } from '$lib/components';
import { page } from '$app/stores'; import { page } from '$app/stores';
import { derived } from '@square/svelte-store'; import { derived } from '@square/svelte-store';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
@ -24,7 +24,6 @@
projects?.find((project) => project.id === page.params.projectId) projects?.find((project) => project.id === page.params.projectId)
); );
let commandPalette: CommandPalette;
let linkProjectModal: LinkProjectModal; let linkProjectModal: LinkProjectModal;
let shareIssueModal: ShareIssueModal; let shareIssueModal: ShareIssueModal;
@ -45,12 +44,9 @@
}) })
.catch((e: any) => toasts.error(e.message)) .catch((e: any) => toasts.error(e.message))
), ),
events.on('openCommandPalette', () => commandPalette?.show()),
events.on('closeCommandPalette', () => commandPalette?.close()),
events.on('goto', (path: string) => goto(path)), events.on('goto', (path: string) => goto(path)),
events.on('openSendIssueModal', () => shareIssueModal?.show()), events.on('openSendIssueModal', () => shareIssueModal?.show()),
hotkeys.on('Meta+k', () => events.emit('openCommandPalette')),
hotkeys.on('Meta+,', () => events.emit('goto', '/users/')), hotkeys.on('Meta+,', () => events.emit('goto', '/users/')),
hotkeys.on('Meta+Shift+N', () => events.emit('openNewProjectModal')), hotkeys.on('Meta+Shift+N', () => events.emit('openNewProjectModal')),
@ -93,10 +89,6 @@
<Toaster /> <Toaster />
{#await Promise.all([projects.load(), project.load()]) then}
<CommandPalette bind:this={commandPalette} {projects} {project} />
{/await}
<LinkProjectModal bind:this={linkProjectModal} {cloud} {projects} /> <LinkProjectModal bind:this={linkProjectModal} {cloud} {projects} />
<ShareIssueModal bind:this={shareIssueModal} user={$user} {cloud} /> <ShareIssueModal bind:this={shareIssueModal} user={$user} {cloud} />