contexted link highlight + adjust prettier
This commit is contained in:
@@ -15,8 +15,7 @@ export const notes = computed<Note[]>(() => {
|
||||
.sort((a, b) => b.modified - a.modified) as Note[]
|
||||
})
|
||||
watch(notes, () => {
|
||||
if (notes.value.length > 0 && !activeNote.value)
|
||||
activeNote.value = rootNote.value
|
||||
if (notes.value.length > 0 && !activeNote.value) activeNote.value = rootNote.value
|
||||
})
|
||||
|
||||
export const activeNote = ref<Note>()
|
||||
@@ -66,11 +65,7 @@ export const updateNote = (noteId: string, note: Note) => {
|
||||
baseNotes[noteId] = updatedNote
|
||||
}
|
||||
|
||||
export const addNote = (
|
||||
title: string,
|
||||
content: string,
|
||||
goToNote: boolean = false
|
||||
) => {
|
||||
export const addNote = (title: string, content: string, goToNote: boolean = false) => {
|
||||
const id = shortid.generate()
|
||||
const newNote: BaseNote = {
|
||||
id,
|
||||
@@ -80,8 +75,7 @@ export const addNote = (
|
||||
modified: new Date().getTime(),
|
||||
}
|
||||
baseNotes[id] = newNote
|
||||
if (goToNote)
|
||||
activeNote.value = notes.value.find((note) => note.id === newNote.id)
|
||||
if (goToNote) activeNote.value = notes.value.find((note) => note.id === newNote.id)
|
||||
}
|
||||
|
||||
const getNoteLinksByNoteId = (noteId: string): string[] => {
|
||||
|
||||
Reference in New Issue
Block a user