mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
33 lines
623 B
JavaScript
33 lines
623 B
JavaScript
import optionsInit from './options_init.js';
|
|
import server from "./server.js";
|
|
import tree from "./tree.js";
|
|
|
|
let hoistedNoteId;
|
|
|
|
optionsInit.optionsReady.then(options => {
|
|
hoistedNoteId = options['hoistedNoteId'];
|
|
});
|
|
|
|
async function getHoistedNoteId() {
|
|
await optionsInit.optionsReady;
|
|
|
|
return hoistedNoteId;
|
|
}
|
|
|
|
async function setHoistedNoteId(noteId) {
|
|
hoistedNoteId = noteId;
|
|
|
|
await server.put('options/hoistedNoteId/' + noteId);
|
|
|
|
await tree.reload();
|
|
}
|
|
|
|
async function unhoist() {
|
|
await setHoistedNoteId('root');
|
|
}
|
|
|
|
export default {
|
|
getHoistedNoteId,
|
|
setHoistedNoteId,
|
|
unhoist
|
|
} |