mirror of
https://github.com/zadam/trilium.git
synced 2025-02-24 23:13:43 +08:00
check for note cache branch existence, #1808
This commit is contained in:
parent
496767a52b
commit
b89ea9a684
1 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const sql = require('./sql');
|
const sql = require('./sql');
|
||||||
|
const log = require('./log');
|
||||||
const repository = require('./repository');
|
const repository = require('./repository');
|
||||||
const Branch = require('../entities/branch');
|
const Branch = require('../entities/branch');
|
||||||
const entityChangesService = require('./entity_changes.js');
|
const entityChangesService = require('./entity_changes.js');
|
||||||
|
@ -139,7 +140,12 @@ function sortNotesByTitle(parentNoteId, foldersFirst = false, reverse = false) {
|
||||||
sql.execute("UPDATE branches SET notePosition = ? WHERE branchId = ?",
|
sql.execute("UPDATE branches SET notePosition = ? WHERE branchId = ?",
|
||||||
[position, note.branchId]);
|
[position, note.branchId]);
|
||||||
|
|
||||||
|
if (note.branchId in noteCache.branches) {
|
||||||
noteCache.branches[note.branchId].notePosition = position;
|
noteCache.branches[note.branchId].notePosition = position;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
log.info(`Branch "${note.branchId}" was not found in note cache.`);
|
||||||
|
}
|
||||||
|
|
||||||
position += 10;
|
position += 10;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue