@@ -176,7 +176,7 @@ export function restart(options = {} as RestartOptions): void {
176176 return ;
177177 }
178178
179- if ( TestUI . testRestarting || TestUI . resultCalculating ) {
179+ if ( TestState . testRestarting || TestUI . resultCalculating ) {
180180 options . event ?. preventDefault ( ) ;
181181 return ;
182182 }
@@ -314,7 +314,7 @@ export function restart(options = {} as RestartOptions): void {
314314 el = $ ( "#typingTest" ) ;
315315 }
316316 TestUI . setResultVisible ( false ) ;
317- TestUI . setTestRestarting ( true ) ;
317+ TestState . setTestRestarting ( true ) ;
318318 el . stop ( true , true ) . animate (
319319 {
320320 opacity : 0 ,
@@ -358,7 +358,7 @@ export function restart(options = {} as RestartOptions): void {
358358 const initResult = await init ( ) ;
359359
360360 if ( ! initResult ) {
361- TestUI . setTestRestarting ( false ) ;
361+ TestState . setTestRestarting ( false ) ;
362362 return ;
363363 }
364364
@@ -396,7 +396,7 @@ export function restart(options = {} as RestartOptions): void {
396396 LiveBurst . reset ( ) ;
397397 TestUI . updatePremid ( ) ;
398398 ManualRestart . reset ( ) ;
399- TestUI . setTestRestarting ( false ) ;
399+ TestState . setTestRestarting ( false ) ;
400400 }
401401 ) ;
402402 }
@@ -420,7 +420,7 @@ async function init(): Promise<boolean> {
420420 ) ;
421421 }
422422 TestInitFailed . show ( ) ;
423- TestUI . setTestRestarting ( false ) ;
423+ TestState . setTestRestarting ( false ) ;
424424 TestState . setTestInitSuccess ( false ) ;
425425 Focus . set ( false ) ;
426426 // Notifications.add(
@@ -1442,7 +1442,7 @@ $(".pageTest").on("click", "#restartTestButtonWithSameWordset", () => {
14421442} ) ;
14431443
14441444$ ( ".pageTest" ) . on ( "click" , "#testConfig .mode .textButton" , ( e ) => {
1445- if ( TestUI . testRestarting ) return ;
1445+ if ( TestState . testRestarting ) return ;
14461446 if ( $ ( e . currentTarget ) . hasClass ( "active" ) ) return ;
14471447 const mode = ( $ ( e . currentTarget ) . attr ( "mode" ) ?? "time" ) as Mode ;
14481448 if ( mode === undefined ) return ;
@@ -1453,7 +1453,7 @@ $(".pageTest").on("click", "#testConfig .mode .textButton", (e) => {
14531453} ) ;
14541454
14551455$ ( ".pageTest" ) . on ( "click" , "#testConfig .wordCount .textButton" , ( e ) => {
1456- if ( TestUI . testRestarting ) return ;
1456+ if ( TestState . testRestarting ) return ;
14571457 const wrd = $ ( e . currentTarget ) . attr ( "wordCount" ) ?? "15" ;
14581458 if ( wrd !== "custom" ) {
14591459 if ( UpdateConfig . setWordCount ( parseInt ( wrd ) ) ) {
@@ -1464,7 +1464,7 @@ $(".pageTest").on("click", "#testConfig .wordCount .textButton", (e) => {
14641464} ) ;
14651465
14661466$ ( ".pageTest" ) . on ( "click" , "#testConfig .time .textButton" , ( e ) => {
1467- if ( TestUI . testRestarting ) return ;
1467+ if ( TestState . testRestarting ) return ;
14681468 const mode = $ ( e . currentTarget ) . attr ( "timeConfig" ) ?? "10" ;
14691469 if ( mode !== "custom" ) {
14701470 if ( UpdateConfig . setTimeConfig ( parseInt ( mode ) ) ) {
@@ -1475,7 +1475,7 @@ $(".pageTest").on("click", "#testConfig .time .textButton", (e) => {
14751475} ) ;
14761476
14771477$ ( ".pageTest" ) . on ( "click" , "#testConfig .quoteLength .textButton" , ( e ) => {
1478- if ( TestUI . testRestarting ) return ;
1478+ if ( TestState . testRestarting ) return ;
14791479 const lenAttr = $ ( e . currentTarget ) . attr ( "quoteLength" ) ;
14801480 if ( lenAttr === "all" ) {
14811481 if ( UpdateConfig . setQuoteLengthAll ( ) ) {
@@ -1503,15 +1503,15 @@ $(".pageTest").on("click", "#testConfig .quoteLength .textButton", (e) => {
15031503} ) ;
15041504
15051505$ ( ".pageTest" ) . on ( "click" , "#testConfig .punctuationMode.textButton" , ( ) => {
1506- if ( TestUI . testRestarting ) return ;
1506+ if ( TestState . testRestarting ) return ;
15071507 if ( UpdateConfig . setPunctuation ( ! Config . punctuation ) ) {
15081508 ManualRestart . set ( ) ;
15091509 restart ( ) ;
15101510 }
15111511} ) ;
15121512
15131513$ ( ".pageTest" ) . on ( "click" , "#testConfig .numbersMode.textButton" , ( ) => {
1514- if ( TestUI . testRestarting ) return ;
1514+ if ( TestState . testRestarting ) return ;
15151515 if ( UpdateConfig . setNumbers ( ! Config . numbers ) ) {
15161516 ManualRestart . set ( ) ;
15171517 restart ( ) ;
0 commit comments