moved required cover values into intitial.js

This commit is contained in:
Sam Ludford
2019-05-17 13:12:04 +01:00
committed by Lachlan Kermode
parent db92644624
commit 880a9fab0f
3 changed files with 16 additions and 7 deletions

View File

@@ -38,7 +38,7 @@ export const selectEvents = createSelector(
[getEvents, getActiveTags, getActiveCategories, getTimeRange],
(events, activeTags, activeCategories, timeRange) => {
return events.reduce((acc, event) => {
const isMatchingTag = event.tags.map(tag => activeTags.includes(tag)).some(s => s)
const isMatchingTag = event.tags && event.tags.map(tag => activeTags.includes(tag)).some(s => s)
const isActiveTag = isMatchingTag || activeTags.length === 0
const isActiveCategory = activeCategories.includes(event.category) || activeCategories.length === 0
const isActiveTime = isTimeRangedIn(event, timeRange)