Improve readability in fetchAnnouncements()
This commit is contained in:
parent
23a9a46580
commit
f3d97cf917
|
@ -54,12 +54,14 @@ const announcements = {
|
||||||
a[c.id] = c
|
a[c.id] = c
|
||||||
return a
|
return a
|
||||||
}, {})
|
}, {})
|
||||||
|
const getWithinVisible = announcement => visibleObject[announcement.id]
|
||||||
|
|
||||||
all.forEach(announcement => {
|
all.forEach(announcement => {
|
||||||
if (!visibleObject[announcement.id]) {
|
const visibleAnnouncement = getWithinVisible(announcement)
|
||||||
|
if (!visibleAnnouncement) {
|
||||||
announcement.inactive = true
|
announcement.inactive = true
|
||||||
} else {
|
} else {
|
||||||
announcement.read = visibleObject[announcement.id].read
|
announcement.read = visibleAnnouncement.read
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue