eslint: unused-expression
A ternary operator means that something's going to be assigned to
something, and I think the interpretor might or might not have had
executed that ternary operator before this fix 🤷. Anyway,
rewritten as a if, it's the same as before, except that this time we
know it'll be executed.
This commit is contained in:
parent
89437c5e23
commit
a1834ed76e
1 changed files with 9 additions and 7 deletions
|
|
@ -22,13 +22,15 @@ export const selectRegions = createSelector(
|
|||
filteredImages.forEach((image) => {
|
||||
if (image.region && image.status === 'success') {
|
||||
if (regions[image.region]) {
|
||||
new Date(image.created_at) <
|
||||
new Date(regions[image.region].created_at)
|
||||
? null
|
||||
: (regions[image.region] = {
|
||||
ami: image.ami,
|
||||
created_at: image.created_at,
|
||||
});
|
||||
if (
|
||||
new Date(image.created_at) >
|
||||
new Date(regions[image.region].created_at)
|
||||
) {
|
||||
regions[image.region] = {
|
||||
ami: image.ami,
|
||||
created_at: image.created_at,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
regions[image.region] = {
|
||||
ami: image.ami,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue