Fixed build
This commit is contained in:
@@ -41,7 +41,7 @@ async function createOrOpenNote(item: ResultNote): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onInputEnter(event: CustomEvent<ResultNote>): void {
|
function onInputEnter(event: CustomEvent<ResultNote>): void {
|
||||||
console.log(event.detail)
|
// console.log(event.detail)
|
||||||
openNote(event.detail)
|
openNote(event.detail)
|
||||||
$modal.close()
|
$modal.close()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,20 +34,20 @@ function createSelectedNote() {
|
|||||||
next: () =>
|
next: () =>
|
||||||
update(v => {
|
update(v => {
|
||||||
const notes = get(resultNotes)
|
const notes = get(resultNotes)
|
||||||
let id = notes.findIndex(n => n.path === v?.path)
|
|
||||||
if (!notes.length) return null
|
if (!notes.length) return null
|
||||||
if (id === -1) return notes[0]
|
let id = notes.findIndex(n => n.path === v?.path)
|
||||||
|
if (id === -1) return notes[0] ?? null
|
||||||
id = id < notes.length - 1 ? id + 1 : 0
|
id = id < notes.length - 1 ? id + 1 : 0
|
||||||
return notes[id]
|
return notes[id] ?? null
|
||||||
}),
|
}),
|
||||||
previous: () =>
|
previous: () =>
|
||||||
update(v => {
|
update(v => {
|
||||||
const notes = get(resultNotes)
|
const notes = get(resultNotes)
|
||||||
let id = notes.findIndex(n => n.path === v?.path)
|
|
||||||
if (!notes.length) return null
|
if (!notes.length) return null
|
||||||
if (id === -1) return notes[0]
|
let id = notes.findIndex(n => n.path === v?.path)
|
||||||
|
if (id === -1) return notes[0] ?? null
|
||||||
id = id > 0 ? id - 1 : notes.length - 1
|
id = id > 0 ? id - 1 : notes.length - 1
|
||||||
return notes[id]
|
return notes[id] ?? null
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user