Skip to content

Build your personal knowledge base with Trilium Notes

fix Jump To search input restoration

zadambf548f9d3824
diff --git a/src/public/app/dialogs/jump_to_note.js b/src/public/app/dialogs/jump_to_note.js
index 037fd5b2dd..87e4e72b23 100644
--- a/src/public/app/dialogs/jump_to_note.js
+++ b/src/public/app/dialogs/jump_to_note.js
@@ -30,6 +30,9 @@ export async function showDialog() {
}
else {
$autoComplete
+ // hack, the actual search value is stored in <pre> element next to the search input
+ // this is important because the search input value is replaced with the suggestion note's title
+ .autocomplete("val", $autoComplete.next().text())
.trigger('focus')
.trigger('select');
}
diff --git a/src/services/cls.js b/src/services/cls.js
index c1f8ff6094..c702126069 100644
--- a/src/services/cls.js
+++ b/src/services/cls.js
@@ -6,7 +6,14 @@ function init(callback) {
}
function wrap(callback) {
- return () => init(callback);
+ return () => {
+ try {
+ init(callback);
+ }
+ catch (e) {
+ console.log(`Error occurred: ${e.message}: ${e.stack}`);
+ }
+ }
}
function get(key) {