@@ -155,6 +155,7 @@ function CityMap(props) {
155
155
newClickedCityArray [ newClickedCityArray . length - 1 ] . id === undefined
156
156
) {
157
157
setTimeout ( ( ) => {
158
+
158
159
addMutationId ( data ) ;
159
160
} , 1000 ) ;
160
161
} else {
@@ -603,11 +604,15 @@ function CityMap(props) {
603
604
context = 0 ;
604
605
if ( event . result . context . length === 1 ) {
605
606
countryISO = event . result . context [ 0 ] . short_code . toUpperCase ( ) ;
606
- country = event . result . context [ 0 ] [ "text_en-US" ] ;
607
- }
608
- if ( event . result . context [ i ] . id . slice ( 0 , 7 ) === "country" ) {
607
+ country = event . result . context [ 0 ] [ "text_en-US" ] !== undefined
608
+ ? event . result . context [ 0 ] [ "text_en-US" ]
609
+ : event . result . context [ 0 ] [ "text" ] ;
610
+ } else if ( event . result . context [ i ] . id . slice ( 0 , 7 ) === "country" ) {
609
611
context = i ;
610
- country = event . result . context [ i ] [ "text_en-US" ] ;
612
+ country =
613
+ event . result . context [ i ] [ "text_en-US" ] !== undefined
614
+ ? event . result . context [ i ] [ "text_en-US" ]
615
+ : event . result . context [ i ] [ "text" ] ;
611
616
countryISO = event . result . context [ i ] [ "short_code" ] . toUpperCase ( ) ;
612
617
}
613
618
}
@@ -747,11 +752,9 @@ function CityMap(props) {
747
752
}
748
753
749
754
function handleTripTimingCityHelper ( city ) {
750
- alert ( 'Reached' )
751
755
if ( props . currentTiming !== 1 ) {
752
756
calculateNewTravelScore ( city , "add" ) ;
753
757
}
754
-
755
758
let country = {
756
759
country : city . country ,
757
760
countryISO : city . countryISO ,
@@ -779,7 +782,6 @@ function CityMap(props) {
779
782
let pastCount = tripTimingCounts [ 0 ] ;
780
783
let futureCount = tripTimingCounts [ 1 ] ;
781
784
let liveCount = tripTimingCounts [ 2 ] ;
782
-
783
785
switch ( props . currentTiming ) {
784
786
case 0 :
785
787
pastCount ++ ;
0 commit comments