Skip to content

Commit

Permalink
fix: fix import old prompts without description (Issue #625)
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaBondar committed Jan 30, 2024
1 parent d832517 commit 66268e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils/app/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,20 @@ export const doesEntityContainSearchItem = <
item: T,
searchTerm: string,
) => {
if(!searchTerm) {
return true;
}
if ('messages' in item) {
// Conversation
return doesConversationContainSearchTerm(item, searchTerm);
} else if ('description' in item) {
} else if ('content' in item && 'description' in item) {
// Prompt
return doesPromptContainSearchTerm(item, searchTerm);
} else if ('contentType' in item) {
// DialFile
return doesFileContainSearchTerm(item, searchTerm);
}
throw new Error('unexpected entity');
return false;
};

export const TrueFilter: EntityFilter<ShareInterface> = () => true;
Expand Down

0 comments on commit 66268e5

Please sign in to comment.