mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
19 lines
532 B
JavaScript
19 lines
532 B
JavaScript
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
|
|
}; |