note titles in jump to note start from hoisted note instead of root

This commit is contained in:
azivner
2018-12-13 21:18:35 +01:00
parent 6c16cdb011
commit b774d56cf7
4 changed files with 44 additions and 13 deletions

View File

@@ -0,0 +1,19 @@
const optionService = require('./options');
const sqlInit = require('./sql_init');
const eventService = require('./events');
let hoistedNoteId = 'root';
eventService.subscribe(eventService.ENTITY_CHANGED, async ({entityName, entity}) => {
if (entityName === 'options' && entity.name === 'hoistedNoteId') {
hoistedNoteId = entity.value;
}
});
sqlInit.dbReady.then(async () => {
hoistedNoteId = await optionService.getOption('hoistedNoteId');
});
module.exports = {
getHoistedNoteId: () => hoistedNoteId
};