From 15532c9b4e9c0670e2c4c0f0e3293ab1ca82effc Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 20 Jul 2023 23:43:04 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/8786 --- app/src/search/spread.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/search/spread.ts b/app/src/search/spread.ts index 0b74b16bc..32e7fd831 100644 --- a/app/src/search/spread.ts +++ b/app/src/search/spread.ts @@ -66,11 +66,12 @@ export const openSearch = async (options: { idPath[0] = pathPosix().join(idPath[0], options.searchPath); } } else if (window.siyuan.config.keymap.general.globalSearch.custom === options.hotkey) { - hPath = localData.hPath; - idPath = localData.idPath; - // 历史原因,2.5.2 之前为 string https://github.com/siyuan-note/siyuan/issues/6902 - if (typeof idPath === "string") { - idPath = [idPath]; + if (localData.removed) { + hPath = ""; + idPath = []; + } else { + hPath = localData.hPath; + idPath = localData.idPath; } } @@ -92,7 +93,7 @@ export const openSearch = async (options: { } }); dialog.element.setAttribute("data-key", options.hotkey); - const edit = genSearch( options.app, { + const edit = genSearch(options.app, { removed: localData.removed, k: options.key || localData.k, r: localData.r, @@ -103,7 +104,7 @@ export const openSearch = async (options: { group: localData.group, sort: localData.sort, types: Object.assign({}, localData.types), - page: options.key ? 1 : localData.page + page: options.key ? 1 : localData.page }, dialog.element.querySelector(".b3-dialog__body"), () => { dialog.destroy({focus: "false"}); });