Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix setting the title bar when switching note
zadam8d3262d2321e
diff --git a/src/public/javascripts/services/note_detail_relation_map.js b/src/public/javascripts/services/note_detail_relation_map.jsindex 9a36a22108..3220466bed 100644--- a/src/public/javascripts/services/note_detail_relation_map.js+++ b/src/public/javascripts/services/note_detail_relation_map.js@@ -553,7 +553,13 @@ class NoteDetailRelationMap {getZoom() {const matrixRegex = /matrix\((-?\d*\.?\d+),\s*0,\s*0,\s*-?\d*\.?\d+,\s*-?\d*\.?\d+,\s*-?\d*\.?\d+\)/;- const matches = this.$relationMapContainer.css('transform').match(matrixRegex);+ const transform = this.$relationMapContainer.css('transform');++ const matches = transform.match(matrixRegex);++ if (!matches) {+ throw new Error("Cannot match transform: " + transform);+ }return matches[1];}diff --git a/src/public/javascripts/services/tab_context.js b/src/public/javascripts/services/tab_context.jsindex 51ee4cf1f4..4becfb2648 100644--- a/src/public/javascripts/services/tab_context.js+++ b/src/public/javascripts/services/tab_context.js@@ -101,6 +101,8 @@ class TabContext {this.setCurrentNotePathToHash();+ this.setTitleBar();+setTimeout(async () => {// we include the note into recent list only if the user stayed on the note at least 5 secondsif (notePath && notePath === this.notePath) {@@ -123,6 +125,13 @@ class TabContext {show() {this.$tabContent.show();this.setCurrentNotePathToHash();+ this.setTitleBar();+ }++ setTitleBar() {+ if (!this.$tabContent.is(":visible")) {+ return;+ }document.title = "Trilium Notes";