From bf548f9d382487f1713434502366cd40ebab8e1b Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 1 Sep 2020 00:05:19 +0200 Subject: [PATCH] fix Jump To search input restoration --- src/public/app/dialogs/jump_to_note.js | 3 +++ src/services/cls.js | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/public/app/dialogs/jump_to_note.js b/src/public/app/dialogs/jump_to_note.js index 037fd5b2d..87e4e72b2 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
 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 c1f8ff609..c70212606 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) {