Skip to content

Commit cca0fa3

Browse files
NikschavanCopilot
andauthored
Clear the logic for country code
Co-authored-by: Copilot <[email protected]>
1 parent f8698aa commit cca0fa3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

client/my-sites/stats/geochart/index.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,7 @@ const StatsGeochartWrapper = ( props ) => {
500500
const userCountryCode = useSelector( getCurrentUserCountryCode );
501501

502502
// Use geo location fallback if user country code is not available
503-
const geoLocationReady = ! isGeoLocationLoading && geoCountryCode;
504-
const finalCountryCode = userCountryCode || geoLocationReady || null;
503+
const finalCountryCode = userCountryCode ?? (isGeoLocationLoading ? null : geoCountryCode);
505504

506505
return <ConnectedStatsGeochart { ...props } currentUserCountryCode={ finalCountryCode } />;
507506
};

0 commit comments

Comments
 (0)