mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
refactor(hidden_subtree): deduplicate restoring title
This commit is contained in:
parent
8fda2dd7f1
commit
055e11174d
@ -383,12 +383,6 @@ function checkHiddenSubtreeRecursively(parentNoteId: string, item: HiddenSubtree
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item.id.startsWith("_lb") && note.title !== item.title) {
|
||||
// If the note title is different from the expected title, update it
|
||||
note.title = item.title;
|
||||
note.save();
|
||||
}
|
||||
}
|
||||
|
||||
const attrs = [...(item.attributes || [])];
|
||||
@ -419,7 +413,8 @@ function checkHiddenSubtreeRecursively(parentNoteId: string, item: HiddenSubtree
|
||||
}
|
||||
}
|
||||
|
||||
if ((extraOpts.restoreNames || note.noteId.startsWith("_help")) && note.title !== item.title) {
|
||||
const shouldRestoreNames = extraOpts.restoreNames || note.noteId.startsWith("_help") || item.id.startsWith("_lb");
|
||||
if (shouldRestoreNames && note.title !== item.title) {
|
||||
note.title = item.title;
|
||||
note.save();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user