From fca0b82610e2eed352f00da784851274a0fe7af2 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 17 May 2022 22:11:45 +0200 Subject: [PATCH] find widget fixes --- package-lock.json | 25 ++++++------------- package.json | 2 +- src/public/app/widgets/find.js | 1 - .../app/widgets/type_widgets/editable_code.js | 4 +-- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa9248ab0..57db450ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,14 +24,13 @@ "ejs": "3.1.8", "electron-debug": "3.2.0", "electron-dl": "3.3.1", - "electron-find": "1.0.7", "electron-window-state": "5.0.3", "express": "4.18.1", "express-partial-content": "1.0.2", "express-rate-limit": "6.4.0", "express-session": "1.17.3", "fs-extra": "10.1.0", - "helmet": "5.0.2", + "helmet": "5.1.0", "html": "1.0.0", "html2plaintext": "2.1.4", "http-proxy-agent": "5.0.0", @@ -3758,11 +3757,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/electron-find": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/electron-find/-/electron-find-1.0.7.tgz", - "integrity": "sha512-C2FQJuk8567P2a2loBNwl5c8kwOTQVMB0capgHtPI7zKwZG16X0UxG+sNYZExQfnJ0PA+ecECA/4LcXxQa2TCA==" - }, "node_modules/electron-installer-common": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/electron-installer-common/-/electron-installer-common-0.10.3.tgz", @@ -5940,9 +5934,9 @@ } }, "node_modules/helmet": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/helmet/-/helmet-5.0.2.tgz", - "integrity": "sha512-QWlwUZZ8BtlvwYVTSDTBChGf8EOcQ2LkGMnQJxSzD1mUu8CCjXJZq/BXP8eWw4kikRnzlhtYo3lCk0ucmYA3Vg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/helmet/-/helmet-5.1.0.tgz", + "integrity": "sha512-klsunXs8rgNSZoaUrNeuCiWUxyc+wzucnEnFejUg3/A+CaF589k9qepLZZ1Jehnzig7YbD4hEuscGXuBY3fq+g==", "engines": { "node": ">=12.0.0" } @@ -14125,11 +14119,6 @@ "unused-filename": "^2.1.0" } }, - "electron-find": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/electron-find/-/electron-find-1.0.7.tgz", - "integrity": "sha512-C2FQJuk8567P2a2loBNwl5c8kwOTQVMB0capgHtPI7zKwZG16X0UxG+sNYZExQfnJ0PA+ecECA/4LcXxQa2TCA==" - }, "electron-installer-common": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/electron-installer-common/-/electron-installer-common-0.10.3.tgz", @@ -15684,9 +15673,9 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, "helmet": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/helmet/-/helmet-5.0.2.tgz", - "integrity": "sha512-QWlwUZZ8BtlvwYVTSDTBChGf8EOcQ2LkGMnQJxSzD1mUu8CCjXJZq/BXP8eWw4kikRnzlhtYo3lCk0ucmYA3Vg==" + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/helmet/-/helmet-5.1.0.tgz", + "integrity": "sha512-klsunXs8rgNSZoaUrNeuCiWUxyc+wzucnEnFejUg3/A+CaF589k9qepLZZ1Jehnzig7YbD4hEuscGXuBY3fq+g==" }, "hosted-git-info": { "version": "2.8.9", diff --git a/package.json b/package.json index 5b7042461..e1a373cc3 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "express-rate-limit": "6.4.0", "express-session": "1.17.3", "fs-extra": "10.1.0", - "helmet": "5.0.2", + "helmet": "5.1.0", "html": "1.0.0", "html2plaintext": "2.1.4", "http-proxy-agent": "5.0.0", diff --git a/src/public/app/widgets/find.js b/src/public/app/widgets/find.js index b204cffb1..0c8975886 100644 --- a/src/public/app/widgets/find.js +++ b/src/public/app/widgets/find.js @@ -80,7 +80,6 @@ export default class FindWidget extends NoteContextAwareWidget { this.$caseSensitiveCheckbox.change(() => this.performFind()); this.$matchWordsCheckbox = this.$widget.find(".find-widget-match-words-checkbox"); this.$matchWordsCheckbox.change(() => this.performFind()); - this.findResult = null; this.searchTerm = null; this.$input.keydown(async e => { diff --git a/src/public/app/widgets/type_widgets/editable_code.js b/src/public/app/widgets/type_widgets/editable_code.js index 7bbc356c3..afffd9e8a 100644 --- a/src/public/app/widgets/type_widgets/editable_code.js +++ b/src/public/app/widgets/type_widgets/editable_code.js @@ -171,13 +171,13 @@ export default class EditableCodeTypeWidget extends TypeWidget { } } - async executeInActiveCodeEditorEvent({callback}) { + async executeInActiveCodeEditorEvent({resolve}) { if (!this.isActive()) { return; } await this.initialized; - callback(this.codeEditor); + resolve(this.codeEditor); } }