mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-24 22:37:38 -05:00
refac
This commit is contained in:
1 parent
061aeae187
commit
d599f7a08e
3 files changed
+10
-6
No files matched your search
@@ -82,7 +82,7 @@
|
||||
</div>
|
||||
{:else}
|
||||
{@const groups = groupNotes(notes)}
|
||||
<div class="scrollbar-hidden h-full overflow-y-auto px-3 pb-6 @container">
|
||||
<div class="scrollbar-hidden h-full overflow-y-auto px-3 pt-1.5 pb-6 @container">
|
||||
{#each groups as [timeRange, notesList], idx (timeRange)}
|
||||
<div class="w-full px-2 pb-1 text-xs text-base-500 dark:text-base-500">
|
||||
{$i18n.t(timeRange)}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
import Tooltip from '../common/Tooltip.svelte';
|
||||
import NoteItem from './Notes/NoteItem.svelte';
|
||||
import NoteMenu from './Notes/NoteMenu.svelte';
|
||||
import { refreshFolderChatLists } from '$lib/stores/chatList';
|
||||
import { refreshFolderChatLists, registerFolderRefreshHandler } from '$lib/stores/chatList';
|
||||
import TagIcon from '../icons/Tag.svelte';
|
||||
import { tagDot, type FolderTag } from '$lib/utils/tags';
|
||||
import FileNavIcon from '../chat/FileNav/Icon.svelte';
|
||||
@@ -171,7 +171,7 @@
|
||||
if (!res) return;
|
||||
|
||||
toast.success($i18n.t('Note moved successfully'));
|
||||
getItemsPage(true);
|
||||
await getItemsPage(true);
|
||||
for (const id of [note.folder_id, folderId]) if (id) void refreshFolderChatLists(id);
|
||||
};
|
||||
|
||||
@@ -484,12 +484,18 @@
|
||||
shiftKey = false;
|
||||
};
|
||||
|
||||
// A note dropped on a sidebar folder.
|
||||
const unregister = registerFolderRefreshHandler(() => {
|
||||
if ($active) return getItemsPage(true);
|
||||
});
|
||||
|
||||
window.addEventListener('focusin', onFocusIn);
|
||||
window.addEventListener('keydown', onKeyDown);
|
||||
window.addEventListener('keyup', onKeyUp);
|
||||
window.addEventListener('blur', onBlur);
|
||||
|
||||
return () => {
|
||||
unregister();
|
||||
searchController?.abort();
|
||||
clearTimeout(searchDebounceTimer);
|
||||
|
||||
|
||||
@@ -47,9 +47,7 @@
|
||||
let menuOpen = false;
|
||||
$: if (shiftKey) menuOpen = false;
|
||||
|
||||
// $folders holds the user's own folders: their owner may also move others' notes within them.
|
||||
$: folder = note.folder_id ? $folders.find((item) => item.id === note.folder_id) : null;
|
||||
$: isOwner = note.user_id === $user?.id;
|
||||
|
||||
// Inline rename, like the folder chat list.
|
||||
let renaming = false;
|
||||
@@ -251,7 +249,7 @@
|
||||
show={menuOpen}
|
||||
folderId={note.folder_id}
|
||||
onRename={editable ? startRename : null}
|
||||
onMove={isOwner || folder ? moveHandler : null}
|
||||
onMove={note.user_id === $user?.id ? moveHandler : null}
|
||||
onDownload={downloadHandler}
|
||||
onCopyLink={copyLinkHandler}
|
||||
onDelete={onDelete ? () => onDelete?.(true) : null}
|
||||
|
||||
Reference in new issue
Block a user