@@ -252,6 +252,9 @@ function compareInput() {
252252 ret += '<letter class="correct">' + currentWord [ i ] + "</letter>" ;
253253 // $(letterElems[i]).removeClass('incorrect').addClass('correct');
254254 } else {
255+ if ( config . difficulty == "master" ) {
256+ showResult ( ) ;
257+ }
255258 if ( currentWord [ i ] == undefined ) {
256259 ret +=
257260 '<letter class="incorrect extra">' + currentInput [ i ] + "</letter>" ;
@@ -516,9 +519,9 @@ function showResult() {
516519 restartCount : restartCount
517520 } ;
518521 restartCount = 0 ;
519- if ( stats . wpm > 0 && stats . wpm < 600 && stats . acc > 50 && stats . acc <= 100 ) {
522+ if ( stats . wpm > 0 && stats . wpm < 350 && stats . acc > 50 && stats . acc <= 100 ) {
520523 if ( firebase . auth ( ) . currentUser != null ) {
521- db_getUserHighestWpm ( config . mode , mode2 , config . punctuation , config . language ) . then ( data => {
524+ db_getUserHighestWpm ( config . mode , mode2 , config . punctuation , config . language , config . difficulty ) . then ( data => {
522525 // console.log(`highest wpm for this mode is ${data}, current is ${stats.wpm}`);
523526 if ( data < stats . wpm ) {
524527 hideCrown ( ) ;
@@ -570,6 +573,11 @@ function showResult() {
570573 if ( config . punctuation ) {
571574 infoText += "<br>punctuation"
572575 }
576+ if ( config . difficulty == "expert" ) {
577+ infoText += "<br>expert" ;
578+ } else if ( config . difficulty == "master" ) {
579+ infoText += "<br>master" ;
580+ }
573581
574582 $ ( "#result .stats .info .bottom" ) . html ( infoText ) ;
575583
@@ -1231,7 +1239,7 @@ $(document).keydown((event) => {
12311239 highlightBadWord ( ) ;
12321240 currentInput = "" ;
12331241 currentWordIndex ++ ;
1234- if ( currentWordIndex == wordsList . length ) {
1242+ if ( currentWordIndex == wordsList . length || config . difficulty == "expert" ) {
12351243 showResult ( ) ;
12361244 return ;
12371245 }
0 commit comments