867867 }
868868 if ( ( method === 1 && workTime > 60000 ) || ( method === 2 && restTime > 60000 ) ) moreThanOneMin = 1 ;
869869 else moreThanOneMin = 0 ; //if less than 1 min, prevent less than 1min warning
870- lastRecordedMinutesLeft = - 1 , lastRecordedHoursLeft = - 1 , lastRecordedProgress = 0.00 ;
870+ lastRecordedMinutesLeft = - 1 , lastRecordedHoursLeft = - 1 , lastRecordedProgress = 0.00 , lastRecordedSecond = - 1 ;
871871 canStop = false ;
872872 timingData . set ( "last-recorded-minutes-left" , - 1 ) ;
873873 timingData . set ( "last-recorded-hours-left" , - 1 ) ;
@@ -1351,14 +1351,36 @@ <h3>
13511351 minutes = Math . floor ( ( seconds - hours * 3600 ) / 60 ) ;
13521352 remainMinutes = hours * 60 + minutes ;
13531353
1354+ if ( progress !== lastRecordedProgress ) {
1355+ lastRecordedProgress = progress ;
1356+ naturalProgress = Math . round ( lastRecordedProgress * 100 ) ;
1357+ $bottomBar . css ( "width" , naturalProgress + "%" ) ;
1358+ ipc . send ( "progress-bar-set" , {
1359+ progress : progress ,
1360+ remain : minutes + hours * 60 ,
1361+ positive : false
1362+ } ) ;
1363+ if ( hasFloating && ! ( hours === 0 && minutes === 0 ) ) {
1364+ ipc . send ( "floating-conversation" , {
1365+ topic : "time-left" ,
1366+ val : seconds / 60 ,
1367+ percentage : naturalProgress ,
1368+ method : method ,
1369+ isWorking : isClockWorking ,
1370+ isOnlyRest : isOnlyRest
1371+ } ) ;
1372+ }
1373+ }
1374+
13541375 if ( hours === 0 && minutes === 0 && ( lastRecordedSecond !== seconds ) ) {
13551376 lastRecordedSecond = seconds ;
13561377 if ( hasFloating ) ipc . send ( "floating-conversation" , {
13571378 topic : "time-left" ,
13581379 val : seconds / 60 ,
13591380 percentage : naturalProgress ,
13601381 method : method ,
1361- isWorking : isClockWorking
1382+ isWorking : isClockWorking ,
1383+ isOnlyRest : isOnlyRest
13621384 } ) ;
13631385 }
13641386
@@ -1376,25 +1398,6 @@ <h3>
13761398 } ) ;
13771399 }
13781400
1379- if ( progress !== lastRecordedProgress ) {
1380- lastRecordedProgress = progress ;
1381- naturalProgress = Math . round ( lastRecordedProgress * 100 ) ;
1382- ipc . send ( "progress-bar-set" , {
1383- progress : progress ,
1384- remain : minutes + hours * 60 ,
1385- positive : false
1386- } ) ;
1387- if ( hasFloating ) ipc . send ( "floating-conversation" , {
1388- topic : "time-left" ,
1389- val : seconds / 60 ,
1390- percentage : naturalProgress ,
1391- method : method ,
1392- isWorking : isClockWorking ,
1393- isOnlyRest : isOnlyRest
1394- } ) ;
1395- $bottomBar . css ( "width" , naturalProgress + "%" ) ;
1396- }
1397-
13981401 seconds -= hours * 3600 + minutes * 60 ;
13991402 $nowTiming . text ( hours + h + minutes + min + seconds + s ) ;
14001403
0 commit comments