Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(notes): update folder selection when moving notes between folders (#678)

Gabriel Stein33b6c095bcd9
diff --git a/src/components/notes/PersonalNotesView.tsx b/src/components/notes/PersonalNotesView.tsx
index 53443793b..6c986de79 100644
--- a/src/components/notes/PersonalNotesView.tsx
+++ b/src/components/notes/PersonalNotesView.tsx
@@ -61,6 +61,7 @@ import {
initializeNotes,
setActiveNoteId,
setActiveFolderId,
+ removeNote,
} from "../../stores/noteStore";
import { useMeetingTranscription } from "../../hooks/useMeetingTranscription";
import { useNotesOnboarding } from "../../hooks/useNotesOnboarding";
@@ -407,11 +408,14 @@ export default function PersonalNotesView({
const handleMoveToFolder = useCallback(
async (noteId: number, folderId: number) => {
await window.electronAPI.updateNote(noteId, { folder_id: folderId });
- // Don't re-filter notes — the IPC onNoteUpdated listener updates the note
- // in the store, and we stay on the current note. Folder counts refresh below.
+ if (noteId === activeNoteId) {
+ setActiveFolderId(folderId);
+ } else {
+ removeNote(noteId);
+ }
loadFolders();
},
- [loadFolders]
+ [activeNoteId, loadFolders]
);
const { dragState, noteDragHandlers, folderDropHandlers } = useNoteDragAndDrop({