mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 01:05:49 +01:00
refactoring to allow unit tests of the whole search subsystem
This commit is contained in:
@@ -1,19 +1,6 @@
|
||||
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
|
||||
};
|
||||
getHoistedNoteId: () => hoistedNoteId,
|
||||
setHoistedNoteId(noteId) { hoistedNoteId = noteId; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user