From 0774e263f5a0a2f47a6697c790ec5b62d61fb8c6 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 29 Nov 2022 23:25:01 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=97=A0=E7=BC=93=E5=AD=98=E4=B8=8D?= =?UTF-8?q?=E5=B1=95=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/search/util.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/search/util.ts b/app/src/search/util.ts index a7606965f..e22505e6e 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -340,6 +340,9 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: () event.preventDefault(); break; } else if (target.id === "searchHistoryBtn") { + if (!config.list || config.list.length === 0) { + return; + } let html = ""; (config.list || []).forEach((s: string) => { if (s !== searchInputElement.value) { @@ -353,6 +356,9 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: () event.preventDefault(); return; } else if (target.id === "replaceHistoryBtn") { + if (!config.replaceList || config.replaceList.length === 0) { + return; + } let html = ""; (config.replaceList || []).forEach((s: string) => { if (s !== replaceInputElement.value) {