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

Function openNote

src/renderer/composables/useCommandPalette.ts:1369–1396  ·  view source on GitHub ↗
(note: NoteResult)

Source from the content-addressed store, hash-verified

1367}
1368
1369async function openNote(note: NoteResult) {
1370 notesData.isRestoreStateBlocked.value = true
1371 noteSearch.clearSearch(false)
1372 notesApp.hideNotesViewModes()
1373 notesApp.notesState.tagId = undefined
1374 notesApp.focusedFolderId.value = undefined
1375 notesApp.highlightedFolderIds.value.clear()
1376 notesApp.highlightedTagId.value = undefined
1377
1378 const query = note.folder?.id
1379 ? { folderId: note.folder.id, isDeleted: note.isDeleted }
1380 : { isDeleted: note.isDeleted }
1381
1382 if (note.folder?.id) {
1383 notesApp.notesState.folderId = note.folder.id
1384 notesApp.notesState.libraryFilter = undefined
1385 }
1386 else {
1387 notesApp.notesState.folderId = undefined
1388 notesApp.notesState.libraryFilter = note.isDeleted
1389 ? LibraryFilter.Trash
1390 : LibraryFilter.All
1391 }
1392
1393 await notesData.getNotes(query)
1394 notesData.selectNote(note.id)
1395 await router.push({ name: RouterName.notesSpace })
1396}
1397
1398async function openHttpRequest(request: HttpRequestResult) {
1399 const httpFolders = useHttpFolders()

Callers 2

openRecentFunction · 0.85
openResultFunction · 0.85

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected