Skip to content

Commit

Permalink
fix: remove empty values from search key array
Browse files Browse the repository at this point in the history
close #2831
  • Loading branch information
hamed-musallam committed Jan 19, 2024
1 parent 14b344c commit 7fe44d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/component/panels/databasePanel/DatabasePanel.tsx
Expand Up @@ -66,7 +66,12 @@ const emptyKeywords = {
};

function mapKeywordsToArray(searchKeywords: string, solvent: string) {
const values = searchKeywords ? searchKeywords.split(' ') : [];
const values = searchKeywords
? searchKeywords
.trim()
.split(' ')
.filter((value) => value !== '')
: [];
if (solvent !== '-1') {
values.unshift(`solvent:${solvent}`);
}
Expand Down

0 comments on commit 7fe44d2

Please sign in to comment.