mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
server-ts: Port services/tree
This commit is contained in:
@@ -267,17 +267,19 @@ class BBranch extends AbstractBeccaEntity<BBranch> {
|
||||
};
|
||||
}
|
||||
|
||||
createClone(parentNoteId: string, notePosition: number) {
|
||||
createClone(parentNoteId: string, notePosition?: number) {
|
||||
const existingBranch = this.becca.getBranchFromChildAndParent(this.noteId, parentNoteId);
|
||||
|
||||
if (existingBranch) {
|
||||
existingBranch.notePosition = notePosition;
|
||||
if (notePosition) {
|
||||
existingBranch.notePosition = notePosition;
|
||||
}
|
||||
return existingBranch;
|
||||
} else {
|
||||
return new BBranch({
|
||||
noteId: this.noteId,
|
||||
parentNoteId: parentNoteId,
|
||||
notePosition: notePosition,
|
||||
notePosition: notePosition || null,
|
||||
prefix: this.prefix,
|
||||
isExpanded: this.isExpanded
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user