From c4c9f0e368eac76de4d1505ea78e461854d32eae Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 15 Jun 2019 10:09:21 -0700 Subject: [PATCH] Fixed: Issue searching for series in the UI when tag is removed --- .../Page/Header/SeriesSearchInputConnector.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js b/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js index f1b7e81e8..99b92fec1 100644 --- a/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js +++ b/frontend/src/Components/Page/Header/SeriesSearchInputConnector.js @@ -28,9 +28,15 @@ function createCleanSeriesSelector() { images, alternateTitles, firstCharacter: title.charAt(0).toLowerCase(), - tags: tags.map((id) => { - return allTags.find((tag) => tag.id === id); - }) + tags: tags.reduce((acc, id) => { + const matchingTag = allTags.find((tag) => tag.id === id); + + if (matchingTag) { + acc.push(matchingTag); + } + + return acc; + }, []) }; }); }