Closed blingusblongus closed 1 year ago
Instead of checking first index at the leaf level, implement a pattern that filters at the level, and passes state down.
This avoids undefined issues when entries[0] doesn't exist, and reduces the number of checks we need to do to one.
now checking from view level based on inDraftState = entries.filter(entry => entry.status !== 'draft') (checking whether any weekly entries are not drafts)
inDraftState = entries.filter(entry => entry.status !== 'draft')
Instead of checking first index at the leaf level, implement a pattern that filters at the level, and passes state down.
This avoids undefined issues when entries[0] doesn't exist, and reduces the number of checks we need to do to one.