mirror of
https://github.com/zadam/trilium.git
synced 2025-01-16 03:58:53 +08:00
fix recent changes showing deleted search note, closes #1331
This commit is contained in:
parent
c671b0a345
commit
8901c3ec91
2 changed files with 4 additions and 3 deletions
|
@ -191,8 +191,8 @@ class TreeCache {
|
|||
if (note.type === 'search') {
|
||||
const searchResultNoteIds = await server.get('search-note/' + note.noteId);
|
||||
|
||||
if (!searchResultNoteIds) {
|
||||
throw new Error(`Search note ${note.noteId} failed.`);
|
||||
if (!Array.isArray(searchResultNoteIds)) {
|
||||
throw new Error(`Search note ${note.noteId} failed: ${searchResultNoteIds}`);
|
||||
}
|
||||
|
||||
// force to load all the notes at once instead of one by one
|
||||
|
|
|
@ -38,7 +38,8 @@ async function searchFromNote(req) {
|
|||
}
|
||||
|
||||
if (note.isDeleted) {
|
||||
return [400, `Note ${req.params.noteId} is deleted.`];
|
||||
// this can be triggered from recent changes and it's harmless to return empty list rather than fail
|
||||
return [];
|
||||
}
|
||||
|
||||
if (note.type !== 'search') {
|
||||
|
|
Loading…
Reference in a new issue