diff --git a/memento-note/components/note-inline-editor.tsx b/memento-note/components/note-inline-editor.tsx index 4056963..00aef5e 100644 --- a/memento-note/components/note-inline-editor.tsx +++ b/memento-note/components/note-inline-editor.tsx @@ -333,6 +333,7 @@ export function NoteInlineEditor({ startTransition(async () => { await deleteNote(note.id) onDelete?.(note.id) + triggerRefresh() }) } diff --git a/memento-note/components/notes-tabs-view.tsx b/memento-note/components/notes-tabs-view.tsx index c4bf1c2..eb06f09 100644 --- a/memento-note/components/notes-tabs-view.tsx +++ b/memento-note/components/notes-tabs-view.tsx @@ -1,6 +1,7 @@ 'use client' import { useCallback, useEffect, useState, useTransition } from 'react' +import { useNoteRefreshOptional } from '@/context/NoteRefreshContext' import { DndContext, type DragEndEvent, @@ -266,6 +267,7 @@ function SortableNoteListItem({ export function NotesTabsView({ notes, onEdit, currentNotebookId }: NotesTabsViewProps) { const { t, language } = useLanguage() + const { triggerRefresh } = useNoteRefreshOptional() const [items, setItems] = useState(notes) const [selectedId, setSelectedId] = useState(null) const [isCreating, startCreating] = useTransition() @@ -496,6 +498,7 @@ export function NotesTabsView({ notes, onEdit, currentNotebookId }: NotesTabsVie setItems((prev) => prev.filter((n) => n.id !== noteToDelete.id)) setSelectedId((prev) => (prev === noteToDelete.id ? null : prev)) setNoteToDelete(null) + triggerRefresh() toast.success(t('notes.deleted')) } catch { toast.error(t('notes.deleteFailed'))