mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
renamed start_note_tree_id option to startNotePath
This commit is contained in:
parent
f1256423ac
commit
6fad30e9af
@ -0,0 +1 @@
|
|||||||
|
UPDATE options SET opt_name = 'start_note_path' WHERE opt_name = 'start_note_tree_id';
|
@ -4,7 +4,7 @@ const noteTree = (function() {
|
|||||||
const treeEl = $("#tree");
|
const treeEl = $("#tree");
|
||||||
const parentListEl = $("#parent-list");
|
const parentListEl = $("#parent-list");
|
||||||
|
|
||||||
let startNoteTreeId = null;
|
let startNotePath = null;
|
||||||
let notesTreeMap = {};
|
let notesTreeMap = {};
|
||||||
|
|
||||||
let parentToChildren = {};
|
let parentToChildren = {};
|
||||||
@ -412,8 +412,8 @@ const noteTree = (function() {
|
|||||||
setExpandedToServer(data.node.data.note_tree_id, false);
|
setExpandedToServer(data.node.data.note_tree_id, false);
|
||||||
},
|
},
|
||||||
init: (event, data) => {
|
init: (event, data) => {
|
||||||
if (startNoteTreeId) {
|
if (startNotePath) {
|
||||||
activateNode(startNoteTreeId);
|
activateNode(startNotePath);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
showAppIfHidden();
|
showAppIfHidden();
|
||||||
@ -503,10 +503,10 @@ const noteTree = (function() {
|
|||||||
|
|
||||||
function loadTree() {
|
function loadTree() {
|
||||||
return server.get('tree').then(resp => {
|
return server.get('tree').then(resp => {
|
||||||
startNoteTreeId = resp.start_note_tree_id;
|
startNotePath = resp.start_note_path;
|
||||||
|
|
||||||
if (document.location.hash) {
|
if (document.location.hash) {
|
||||||
startNoteTreeId = document.location.hash.substr(1); // strip initial #
|
startNotePath = document.location.hash.substr(1); // strip initial #
|
||||||
}
|
}
|
||||||
|
|
||||||
return prepareNoteTree(resp.notes, resp.notes_parent);
|
return prepareNoteTree(resp.notes, resp.notes_parent);
|
||||||
|
@ -26,7 +26,7 @@ router.put('/:noteTreeId/:notePath', auth.checkApiAuth, async (req, res, next) =
|
|||||||
|
|
||||||
await sync_table.addRecentNoteSync(noteTreeId);
|
await sync_table.addRecentNoteSync(noteTreeId);
|
||||||
|
|
||||||
await options.setOption('start_note_tree_id', notePath);
|
await options.setOption('start_note_path', notePath);
|
||||||
});
|
});
|
||||||
|
|
||||||
res.send(await getRecentNotes());
|
res.send(await getRecentNotes());
|
||||||
|
@ -31,7 +31,7 @@ router.get('/', auth.checkApiAuth, async (req, res, next) => {
|
|||||||
|
|
||||||
res.send({
|
res.send({
|
||||||
notes: notes,
|
notes: notes,
|
||||||
start_note_tree_id: await options.getOption('start_note_tree_id')
|
start_note_path: await options.getOption('start_note_path')
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
const build = require('./build');
|
const build = require('./build');
|
||||||
const packageJson = require('../package');
|
const packageJson = require('../package');
|
||||||
|
|
||||||
const APP_DB_VERSION = 48;
|
const APP_DB_VERSION = 49;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
app_version: packageJson.version,
|
app_version: packageJson.version,
|
||||||
|
@ -28,7 +28,7 @@ async function setOption(optName, optValue) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function initOptions(startNoteTreeId) {
|
async function initOptions(startNotePath) {
|
||||||
await setOption('document_id', utils.randomSecureToken(16));
|
await setOption('document_id', utils.randomSecureToken(16));
|
||||||
await setOption('document_secret', utils.randomSecureToken(16));
|
await setOption('document_secret', utils.randomSecureToken(16));
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ async function initOptions(startNoteTreeId) {
|
|||||||
await setOption('encrypted_data_key', '');
|
await setOption('encrypted_data_key', '');
|
||||||
await setOption('encrypted_data_key_iv', '');
|
await setOption('encrypted_data_key_iv', '');
|
||||||
|
|
||||||
await setOption('start_note_tree_id', startNoteTreeId);
|
await setOption('start_note_path', startNotePath);
|
||||||
await setOption('protected_session_timeout', 600);
|
await setOption('protected_session_timeout', 600);
|
||||||
await setOption('history_snapshot_time_interval', 600);
|
await setOption('history_snapshot_time_interval', 600);
|
||||||
await setOption('last_backup_date', utils.nowTimestamp());
|
await setOption('last_backup_date', utils.nowTimestamp());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user