From 87a4598391d7a4da344548178bfede4b4ed5966e Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 5 Mar 2019 14:09:08 +0100 Subject: [PATCH] Ensured maps modal btn is not rendered when the number of located cities is 0 --- src/visits/ShortUrlVisits.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/visits/ShortUrlVisits.js b/src/visits/ShortUrlVisits.js index cd14bc22..566074df 100644 --- a/src/visits/ShortUrlVisits.js +++ b/src/visits/ShortUrlVisits.js @@ -76,6 +76,7 @@ const ShortUrlVisits = ({ processStatsFromVisits }) => class ShortUrlVisits exte const { os, browsers, referrers, countries, cities, citiesForMap } = processStatsFromVisits( { id: this.memoizationId, visits } ); + const mapLocations = values(citiesForMap); return (
@@ -109,14 +110,9 @@ const ShortUrlVisits = ({ processStatsFromVisits }) => class ShortUrlVisits exte ( - - ), - ]} + extraHeaderContent={ + [ () => mapLocations.length > 0 && ] + } sortingItems={{ name: 'City name', amount: 'Visits amount',