Skip to content

Build your personal knowledge base with Trilium Notes

make note paths work better with hoisted note

zadam34b897901695
diff --git a/src/public/javascripts/widgets/note_paths.js b/src/public/javascripts/widgets/note_paths.js
index 8801c93ff6..73b0695cc3 100644
--- a/src/public/javascripts/widgets/note_paths.js
+++ b/src/public/javascripts/widgets/note_paths.js
@@ -1,6 +1,7 @@
import TabAwareWidget from "./tab_aware_widget.js";
import treeService from "../services/tree.js";
import linkService from "../services/link.js";
+import hoistedNoteService from "../services/hoisted_note.js";
const TPL = `
<div class="note-paths-widget">
@@ -68,12 +69,18 @@ export default class NotePathsWidget extends TabAwareWidget {
let parentNoteId = 'root';
let curPath = '';
+ let passedHoistedNote = false;
+
for (let i = 0; i < noteIdsPath.length; i++) {
const noteId = noteIdsPath[i];
curPath += (curPath ? '/' : '') + noteId;
- if (noteId !== 'root' || noteIdsPath.length < 3) {
+ if (noteId === hoistedNoteService.getHoistedNoteId()) {
+ passedHoistedNote = true;
+ }
+
+ if (passedHoistedNote && (noteId !== hoistedNoteService.getHoistedNoteId() || noteIdsPath.length - i < 3)) {
this.$currentPath.append(
$("<a>")
.attr('href', '#' + curPath)
diff --git a/src/public/javascripts/widgets/note_tree.js b/src/public/javascripts/widgets/note_tree.js
index 3273e51747..a5dc302964 100644
--- a/src/public/javascripts/widgets/note_tree.js
+++ b/src/public/javascripts/widgets/note_tree.js
@@ -790,7 +790,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
}
forceNoteSyncCommand({node}) {
- syncService.forceNoteSync(noteId);
+ syncService.forceNoteSync(node.data.noteId);
}
editNoteTitleCommand({node}) {
diff --git a/src/services/sql_init.js b/src/services/sql_init.js
index 40ea158b25..b2ef85c515 100644
--- a/src/services/sql_init.js
+++ b/src/services/sql_init.js
@@ -8,6 +8,7 @@ const sql = require('./sql');
const cls = require('./cls');
const utils = require('./utils');
const optionService = require('./options');
+const port = require('./port');
const Option = require('../entities/option');
const TaskContext = require('./task_context.js');
@@ -55,7 +56,7 @@ async function isDbInitialized() {
async function initDbConnection() {
await cls.init(async () => {
if (!await isDbInitialized()) {
- log.info("DB not initialized, please visit setup page to see instructions on how to initialize Trilium.");
+ log.info(`DB not initialized, please visit setup page` + (utils.isElectron() ? '' : ` - http://[your-server-host]:${await port} to see instructions on how to initialize Trilium.`));
return;
}