Improve prompt store prompt list counting
This commit is contained in:
parent
16c16887ae
commit
bc53c17a8c
|
@ -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);
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue