2020-05-21 14:05:56 +02:00
|
|
|
const optionService = require('./options');
|
|
|
|
const sqlInit = require('./sql_init');
|
|
|
|
const eventService = require('./events');
|
|
|
|
const hoistedNote = require('./hoisted_note');
|
|
|
|
|
2020-06-20 12:31:38 +02:00
|
|
|
eventService.subscribe(eventService.ENTITY_CHANGED, ({entityName, entity}) => {
|
2020-05-21 14:05:56 +02:00
|
|
|
if (entityName === 'options' && entity.name === 'hoistedNoteId') {
|
|
|
|
hoistedNote.setHoistedNoteId(entity.value);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2020-06-20 21:42:41 +02:00
|
|
|
sqlInit.dbReady.then(() => {
|
|
|
|
hoistedNote.setHoistedNoteId(optionService.getOption('hoistedNoteId'));
|
|
|
|
});
|