From bc53c17a8c830feb458257e8f11e1097b3256528 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Mon, 15 Jul 2024 00:54:25 +0800 Subject: [PATCH] Improve prompt store prompt list counting --- app/store/prompt.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/store/prompt.ts b/app/store/prompt.ts index 92ff8b370..dcbeebdfb 100644 --- a/app/store/prompt.ts +++ b/app/store/prompt.ts @@ -175,8 +175,9 @@ export const usePromptStore = createPersistStore( const allPromptsForSearch = builtinPrompts .reduce((pre, cur) => pre.concat(cur), []) .filter((v) => !!v.title && !!v.content); - SearchService.count.builtin = - res.en.length + res.cn.length + res.tw.length; + SearchService.count.builtin = Object.values(res) + .filter(Array.isArray) + .reduce((total, promptList) => total + promptList.length, 0); SearchService.init(allPromptsForSearch, userPrompts); }); },