From 8dd363382a7b2e0ee6c4ed873c8db68a7464358e Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 24 Jun 2026 22:58:42 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/17929 --- app/src/mobile/menu/search.ts | 2 +- app/src/search/util.ts | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/mobile/menu/search.ts b/app/src/mobile/menu/search.ts index f05079c7e..6e73688e4 100644 --- a/app/src/mobile/menu/search.ts +++ b/app/src/mobile/menu/search.ts @@ -226,7 +226,7 @@ ${childItem.tag ? ``; listElement.scrollTop = 0; let countHTML = ""; - if (response) { + if (response && response.data.matchedBlockCount > 0) { let text = window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount); if (response.data.docMode) { text = window.siyuan.languages.matchDoc.replace("${x}", response.data.matchedRootCount); diff --git a/app/src/search/util.ts b/app/src/search/util.ts index 003e34afa..e17e1765c 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -1376,12 +1376,16 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchCo nextElement.setAttribute("disabled", "disabled"); } onSearch(response.data.blocks, edit, element, config, focusId); - let text = window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount); - if (response.data.docMode) { - text = window.siyuan.languages.matchDoc.replace("${x}", response.data.matchedRootCount); - } - searchResultElement.innerHTML = `${config.page}/${response.data.pageCount || 1} + if (response.data.matchedBlockCount > 0) { + let text = window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount); + if (response.data.docMode) { + text = window.siyuan.languages.matchDoc.replace("${x}", response.data.matchedRootCount); + } + searchResultElement.innerHTML = `${config.page}/${response.data.pageCount || 1} ${text}`; + } else { + searchResultElement.innerHTML = ""; + } loadingElement.classList.add("fn__none"); searchResultElement.setAttribute("data-pagecount", response.data.pageCount || 1); });