Sfoglia il codice sorgente

switch the description of the search results numbers

kaori 5 anni fa
parent
commit
43e98ae3fa
1 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. 5 2
      src/server/service/bolt.js

+ 5 - 2
src/server/service/bolt.js

@@ -189,8 +189,11 @@ class BoltService {
       const url = new URL(path, base);
       return `<${decodeURI(url.href)} | ${decodeURI(url.pathname)}>`;
     });
-    // TODO: This search results numbers will be improved by GW-5258
-    const keywords = `keyword(s) : "${args}" \n 10 results.`;
+
+    const searchResultsNum = resultPaths.length;
+    const searchResultsDescription = searchResultsNum > 10 ? 'more than 10 pages are found' : `${searchResultsNum} pages are found`;
+
+    const keywords = `keyword(s) : "${args}" \n ${searchResultsDescription}.`;
 
     try {
       await this.client.chat.postEphemeral({