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:
Thomas Lavocat 2023-08-09 17:14:32 +02:00 committed by Lucas Garfield
parent 89437c5e23
commit a1834ed76e

View file

@ -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,