mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac/fix: shortcut modal
This commit is contained in:
parent
43e11aa807
commit
3e67ce6e8e
3 changed files with 7 additions and 7 deletions
|
|
@ -9,7 +9,7 @@
|
||||||
import { getUsage } from '$lib/apis';
|
import { getUsage } from '$lib/apis';
|
||||||
import { userSignOut } from '$lib/apis/auths';
|
import { userSignOut } from '$lib/apis/auths';
|
||||||
|
|
||||||
import { showSettings, mobile, showSidebar, user } from '$lib/stores';
|
import { showSettings, mobile, showSidebar, showShortcuts, user } from '$lib/stores';
|
||||||
|
|
||||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||||
import ArchiveBox from '$lib/components/icons/ArchiveBox.svelte';
|
import ArchiveBox from '$lib/components/icons/ArchiveBox.svelte';
|
||||||
|
|
@ -29,8 +29,6 @@
|
||||||
export let help = false;
|
export let help = false;
|
||||||
export let className = 'max-w-[240px]';
|
export let className = 'max-w-[240px]';
|
||||||
|
|
||||||
let showShortcuts = false;
|
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
let usage = null;
|
let usage = null;
|
||||||
|
|
@ -51,7 +49,7 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ShortcutsModal bind:show={showShortcuts} />
|
<ShortcutsModal bind:show={$showShortcuts} />
|
||||||
|
|
||||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||||
<DropdownMenu.Root
|
<DropdownMenu.Root
|
||||||
|
|
@ -173,7 +171,7 @@
|
||||||
class="flex gap-2 items-center py-1.5 px-3 text-sm select-none w-full cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md transition"
|
class="flex gap-2 items-center py-1.5 px-3 text-sm select-none w-full cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md transition"
|
||||||
id="chat-share-button"
|
id="chat-share-button"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
showShortcuts = !showShortcuts;
|
showShortcuts.set(!$showShortcuts);
|
||||||
show = false;
|
show = false;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ export const settings: Writable<Settings> = writable({});
|
||||||
export const showSidebar = writable(false);
|
export const showSidebar = writable(false);
|
||||||
export const showSearch = writable(false);
|
export const showSearch = writable(false);
|
||||||
export const showSettings = writable(false);
|
export const showSettings = writable(false);
|
||||||
|
export const showShortcuts = writable(false);
|
||||||
export const showArchivedChats = writable(false);
|
export const showArchivedChats = writable(false);
|
||||||
export const showChangelog = writable(false);
|
export const showChangelog = writable(false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
tags,
|
tags,
|
||||||
banners,
|
banners,
|
||||||
showSettings,
|
showSettings,
|
||||||
|
showShortcuts,
|
||||||
showChangelog,
|
showChangelog,
|
||||||
temporaryChatEnabled,
|
temporaryChatEnabled,
|
||||||
toolServers,
|
toolServers,
|
||||||
|
|
@ -185,8 +186,8 @@
|
||||||
// Check if Ctrl + / is pressed
|
// Check if Ctrl + / is pressed
|
||||||
if (isCtrlPressed && event.key === '/') {
|
if (isCtrlPressed && event.key === '/') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
console.log('showShortcuts');
|
|
||||||
document.getElementById('show-shortcuts-button')?.click();
|
showShortcuts.set(!$showShortcuts);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if Ctrl + Shift + ' is pressed
|
// Check if Ctrl + Shift + ' is pressed
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue