From a8d1601b29a22108e2f780e110eab7492aa0f260 Mon Sep 17 00:00:00 2001 From: Khai Truong Date: Wed, 31 Jul 2024 00:21:07 +0700 Subject: [PATCH] fix lint issues --- ext/js/pages/settings/dictionary-controller.js | 15 +++++++++++---- ext/settings.html | 1 - 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js index 4788bff64a..f893544013 100644 --- a/ext/js/pages/settings/dictionary-controller.js +++ b/ext/js/pages/settings/dictionary-controller.js @@ -183,6 +183,14 @@ class DictionaryEntry { } } + /** + * @param {string} alias + */ + updateAliasSettings(alias) { + this._aliasNode.textContent = alias; + this._aliasNode.dispatchEvent(new CustomEvent('change', {bubbles: true})); + } + /** * @param {import('dom-data-binder').SettingChangedEvent} e */ @@ -916,10 +924,9 @@ export class DictionaryController { /** @type {HTMLInputElement} */ const input = querySelectorNotNull(modal.node, '#dictionary-alias-input'); const inputValue = input.value.trim(); - if (!inputValue) return; - const aliasNode = this._dictionaryEntries[indexNumber]._aliasNode; - aliasNode.textContent = inputValue; - aliasNode.dispatchEvent(new Event('change', {bubbles: true})); + if (inputValue) { + this._dictionaryEntries[indexNumber].updateAliasSettings(inputValue); + } } /** diff --git a/ext/settings.html b/ext/settings.html index c858b374c3..c227787454 100644 --- a/ext/settings.html +++ b/ext/settings.html @@ -2835,7 +2835,6 @@
or click here to upload
-