From 0c04941edc0108e00d0b3a663b686c9e06048447 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 20 Nov 2023 22:35:58 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/9700 --- app/src/asset/pdf/view_history.js | 1 + app/src/search/menu.ts | 2 +- app/src/search/util.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/asset/pdf/view_history.js b/app/src/asset/pdf/view_history.js index 9d66be66e..bcbb824d3 100644 --- a/app/src/asset/pdf/view_history.js +++ b/app/src/asset/pdf/view_history.js @@ -13,6 +13,7 @@ * limitations under the License. */ +import {setStorageVal} from "../../protyle/util/compatibility"; const DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20; /** diff --git a/app/src/search/menu.ts b/app/src/search/menu.ts index 95dd5fd1a..5d0f943fa 100644 --- a/app/src/search/menu.ts +++ b/app/src/search/menu.ts @@ -239,7 +239,7 @@ export const saveCriterion = (config: ISearchOption, saveDialog.destroy(); }); btnsElement[1].addEventListener("click", () => { - const value = saveDialog.element.querySelector("input").value; + const value = saveDialog.element.querySelector("input").value.trim(); if (!value) { showMessage(window.siyuan.languages["_kernel"]["142"]); return; diff --git a/app/src/search/util.ts b/app/src/search/util.ts index e1cc46a75..c6e7a92ca 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -409,7 +409,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo event.preventDefault(); break; } else if (target.classList.contains("b3-chip__close") && type === "remove-criteria") { - const name = target.parentElement.innerText.trim(); + const name = target.parentElement.innerText; fetchPost("/api/storage/removeCriterion", {name}); criteriaData.find((item, index) => { if (item.name === name) {