add frontend API method openTabWithNote, #1645

This commit is contained in:
zadam
2021-02-17 23:55:51 +01:00
parent 600a312b2a
commit 8e730c6ecf
24 changed files with 855 additions and 387 deletions

View File

@@ -66,7 +66,7 @@ class Branch extends Entity {
}
beforeSaving() {
if (this.notePosition === undefined) {
if (this.notePosition === undefined || this.notePosition === null) {
const maxNotePos = sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 10;
}
@@ -85,9 +85,7 @@ class Branch extends Entity {
super.beforeSaving();
if (this.isChanged) {
this.utcDateModified = dateUtils.utcNowDateTime();
}
this.utcDateModified = dateUtils.utcNowDateTime();
}
createClone(parentNoteId, notePosition) {