Skip to content

Commit f1be85d

Browse files
committed
refac
1 parent ecd74f2 commit f1be85d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/lib/components/layout/Sidebar.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import { createNewFolder, getFolders, updateFolderParentIdById } from '$lib/apis/folders';
4747
import { checkActiveChats } from '$lib/apis/tasks';
4848
import { getPinnedNoteList, toggleNotePinnedStatusById } from '$lib/apis/notes';
49+
import { createNoteHandler } from '$lib/components/notes/utils';
4950
import { WEBUI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants';
5051
5152
import ArchivedChatsModal from './ArchivedChatsModal.svelte';
@@ -1090,6 +1091,13 @@
10901091
name={$i18n.t('Notes')}
10911092
chevron={false}
10921093
dragAndDrop={false}
1094+
onAdd={async () => {
1095+
const note = await createNoteHandler('New Note');
1096+
if (note) {
1097+
goto(`/notes/${note.id}`);
1098+
}
1099+
}}
1100+
onAddLabel={$i18n.t('New Note')}
10931101
>
10941102
<div class="mt-0.5 pb-1.5">
10951103
{#each $pinnedNotes as note (note.id)}

0 commit comments

Comments
 (0)