@@ -1815,7 +1815,7 @@ export class PomodoroTimer {
18151815 private async startTimer ( ) {
18161816 this . isRunning = true ;
18171817 this . isPaused = false ;
1818-
1818+
18191819 // 记录开始时间,考虑已暂停的时间
18201820 this . startTime = Date . now ( ) - this . pausedTime ;
18211821 this . lastUpdateTime = Date . now ( ) ;
@@ -1839,7 +1839,7 @@ export class PomodoroTimer {
18391839 this . timer = window . setInterval ( ( ) => {
18401840 const currentTime = Date . now ( ) ;
18411841 const elapsedSinceStart = Math . floor ( ( currentTime - this . startTime ) / 1000 ) ;
1842-
1842+
18431843 if ( this . isCountUp ) {
18441844 if ( this . isWorkPhase ) {
18451845 // 正计时工作时间:直接使用经过的时间
@@ -1857,7 +1857,7 @@ export class PomodoroTimer {
18571857 const totalBreakTime = this . isLongBreak ?
18581858 this . settings . longBreakDuration * 60 :
18591859 this . settings . breakDuration * 60 ;
1860-
1860+
18611861 this . breakTimeLeft = totalBreakTime - elapsedSinceStart ;
18621862
18631863 if ( this . breakTimeLeft <= 0 ) {
@@ -1918,7 +1918,7 @@ export class PomodoroTimer {
19181918
19191919 private async resumeTimer ( ) {
19201920 this . isPaused = false ;
1921-
1921+
19221922 // 重新计算开始时间,保持已暂停的时间
19231923 this . startTime = Date . now ( ) - this . pausedTime ;
19241924
@@ -1941,7 +1941,7 @@ export class PomodoroTimer {
19411941 this . timer = window . setInterval ( ( ) => {
19421942 const currentTime = Date . now ( ) ;
19431943 const elapsedSinceStart = Math . floor ( ( currentTime - this . startTime ) / 1000 ) ;
1944-
1944+
19451945 if ( this . isCountUp ) {
19461946 if ( this . isWorkPhase ) {
19471947 this . timeElapsed = elapsedSinceStart ;
@@ -1956,7 +1956,7 @@ export class PomodoroTimer {
19561956 const totalBreakTime = this . isLongBreak ?
19571957 this . settings . longBreakDuration * 60 :
19581958 this . settings . breakDuration * 60 ;
1959-
1959+
19601960 this . breakTimeLeft = totalBreakTime - elapsedSinceStart ;
19611961
19621962 if ( this . breakTimeLeft <= 0 ) {
@@ -2498,7 +2498,7 @@ export class PomodoroTimer {
24982498 this . timer = window . setInterval ( ( ) => {
24992499 const currentTime = Date . now ( ) ;
25002500 const elapsedSinceStart = Math . floor ( ( currentTime - this . startTime ) / 1000 ) ;
2501-
2501+
25022502 if ( this . isCountUp ) {
25032503 this . breakTimeLeft = breakDuration * 60 - elapsedSinceStart ;
25042504 if ( this . breakTimeLeft <= 0 ) {
@@ -2571,7 +2571,7 @@ export class PomodoroTimer {
25712571 this . timer = window . setInterval ( ( ) => {
25722572 const currentTime = Date . now ( ) ;
25732573 const elapsedSinceStart = Math . floor ( ( currentTime - this . startTime ) / 1000 ) ;
2574-
2574+
25752575 if ( this . isCountUp ) {
25762576 this . timeElapsed = elapsedSinceStart ;
25772577
0 commit comments