Improve readability in fetchAnnouncements()
This commit is contained in:
parent
23a9a46580
commit
f3d97cf917
1 changed files with 4 additions and 2 deletions
|
@ -54,12 +54,14 @@ const announcements = {
|
|||
a[c.id] = c
|
||||
return a
|
||||
}, {})
|
||||
const getWithinVisible = announcement => visibleObject[announcement.id]
|
||||
|
||||
all.forEach(announcement => {
|
||||
if (!visibleObject[announcement.id]) {
|
||||
const visibleAnnouncement = getWithinVisible(announcement)
|
||||
if (!visibleAnnouncement) {
|
||||
announcement.inactive = true
|
||||
} else {
|
||||
announcement.read = visibleObject[announcement.id].read
|
||||
announcement.read = visibleAnnouncement.read
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue