@@ -191,6 +191,7 @@ export default {
191191 ' country' ,
192192 ' timeAttack' ,
193193 ' nbRound' ,
194+ ' countdown' ,
194195 ],
195196 components: {
196197 DialogSummary,
@@ -216,6 +217,7 @@ export default {
216217 size: 2 ,
217218 pinActive: false ,
218219 printMapFull: false ,
220+ countdownStarted: false ,
219221 game: {
220222 multiplayer: !! this .roomName ,
221223 date: new Date (),
@@ -362,6 +364,7 @@ export default {
362364 this .isGuessButtonClicked = false ;
363365 this .isSelected = false ;
364366 this .isNextButtonVisible = false ;
367+ this .countdownStarted = false ;
365368
366369 if (this .$viewport .width < 450 ) {
367370 // Hide the map if the player is on mobile
@@ -396,9 +399,10 @@ export default {
396399 this .room .on (' value' , (snapshot ) => {
397400 // Check if the room is already removed
398401 if (snapshot .hasChild (' active' )) {
399- // Allow players to move on to the next round when every players guess locations
400402 if (
403+ // If Time Attack and 1st true guess finish round
401404 (this .timeAttack &&
405+ this .countdown === 0 &&
402406 snapshot .child (' guess' ).numChildren () >= 1 &&
403407 snapshot
404408 .child (' guess' )
@@ -407,6 +411,7 @@ export default {
407411 guess .child (' country' ).val () ===
408412 this .country
409413 )) ||
414+ // Allow players to move on to the next round when every players guess locations
410415 snapshot .child (' guess' ).numChildren () ===
411416 snapshot .child (' size' ).val ()
412417 ) {
@@ -540,6 +545,17 @@ export default {
540545 ) {
541546 this .isNextStreetViewReady = true ;
542547 }
548+
549+ if (
550+ ! this .countdownStarted &&
551+ ! this .printMapFull &&
552+ this .countdown > 0 &&
553+ snapshot .child (' guess' ).numChildren () >= 1
554+ ) {
555+ this .$parent .initTimer (this .countdown , true );
556+
557+ this .countdownStarted = true ;
558+ }
543559 }
544560 });
545561 }
0 commit comments