fix: #829 filter empty prompt

This commit is contained in:
Yidadaa 2023-04-16 18:11:09 +08:00
parent dc3883ed1a
commit ea3e8a7459

View File

@ -116,10 +116,9 @@ export const usePromptStore = create<PromptStore>()(
})
.concat([...(state?.prompts?.values() ?? [])]);
const allPromptsForSearch = builtinPrompts.reduce(
(pre, cur) => pre.concat(cur),
[],
);
const allPromptsForSearch = builtinPrompts
.reduce((pre, cur) => pre.concat(cur), [])
.filter((v) => !!v.title && !!v.content);
SearchService.count.builtin = res.en.length + res.cn.length;
SearchService.init(allPromptsForSearch);
});