Skip to content

Commit

Permalink
fix: #829 filter empty prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Yidadaa committed Apr 16, 2023
1 parent dc3883e commit ea3e8a7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/store/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit ea3e8a7

Please sign in to comment.