added more careful handling of search note operations, fixes #683

This commit is contained in:
zadam
2019-11-04 22:41:06 +01:00
parent df40accdd4
commit 9c9ef1c7b4
7 changed files with 41 additions and 7 deletions

View File

@@ -3,12 +3,16 @@ import server from "./server.js";
import tree from "./tree.js";
import noteDetailService from "./note_detail.js";
let hoistedNoteId;
let hoistedNoteId = 'root';
optionsService.waitForOptions().then(options => {
hoistedNoteId = options.get('hoistedNoteId');
});
function getHoistedNoteNoPromise() {
return hoistedNoteId;
}
async function getHoistedNoteId() {
await optionsService.waitForOptions();
@@ -49,6 +53,7 @@ async function isRootNode(node) {
export default {
getHoistedNoteId,
getHoistedNoteNoPromise,
setHoistedNoteId,
unhoist,
isTopLevelNode,