From d62d04f806d2e6e5f2c3ac69a7d62f00cc31bd1b Mon Sep 17 00:00:00 2001 From: siikamiika Date: Sun, 27 Oct 2019 23:52:16 +0200 Subject: fix wanakana toggle on empty input --- ext/bg/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 65cca002..dbfcb15d 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -69,7 +69,7 @@ class DisplaySearch extends Display { this.wanakanaEnable.checked = false; } this.wanakanaEnable.addEventListener('change', (e) => { - let query = DisplaySearch.getSearchQueryFromLocation(window.location.href); + const query = DisplaySearch.getSearchQueryFromLocation(window.location.href) || ''; if (e.target.checked) { window.wanakana.bind(this.query); this.query.value = window.wanakana.toKana(query); -- cgit v1.2.3