MCPcopy Create free account
hub / github.com/massCodeIO/massCode / selectFirstNote

Function selectFirstNote

src/renderer/composables/spaces/notes/useNotes.ts:750–770  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

748}
749
750export function selectFirstNote() {
751 let firstNote: NoteRecord | undefined
752
753 if (isSearch.value) {
754 firstNote = notesBySearch.value?.[0]
755 }
756 else {
757 firstNote = notes.value?.[0]
758 }
759
760 if (firstNote) {
761 notesState.noteId = firstNote.id
762 selectedNoteIds.value = [firstNote.id]
763 lastSelectedNoteId.value = firstNote.id
764 }
765 else {
766 notesState.noteId = undefined
767 selectedNoteIds.value = []
768 lastSelectedNoteId.value = undefined
769 }
770}
771
772function clearNotes() {
773 notes.value = []

Callers 8

searchFunction · 0.90
initNotesSpaceFunction · 0.85
onExternalDropFunction · 0.85
openTagInNotesWorkspaceFunction · 0.85
deleteSelectedNotesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected