General Bugfixes
This commit is contained in:
10
src/main.ts
10
src/main.ts
@@ -279,6 +279,9 @@ export default class FocusTaskPlugin extends Plugin {
|
||||
const elapsedMs = now - this.timerStartTimestamp;
|
||||
const elapsedSeconds = Math.floor(elapsedMs / 1000);
|
||||
|
||||
// If less than 1 second elapsed, no need to sync
|
||||
if (elapsedSeconds < 1) return;
|
||||
|
||||
if (this.isBreakMode) {
|
||||
// Break mode: countdown timer
|
||||
this.currentTimerSeconds = Math.max(0, this.pausedTimeRemaining - elapsedSeconds);
|
||||
@@ -312,6 +315,10 @@ export default class FocusTaskPlugin extends Plugin {
|
||||
}
|
||||
}
|
||||
|
||||
// Reset timestamp to now to prevent double-counting on next sync
|
||||
this.timerStartTimestamp = now;
|
||||
this.pausedTimeRemaining = this.currentTimerSeconds;
|
||||
|
||||
// Update displays
|
||||
this.updateStatusBar();
|
||||
this.updateTimerDisplay();
|
||||
@@ -538,6 +545,9 @@ export default class FocusTaskPlugin extends Plugin {
|
||||
const task = this.data.tasks.find(t => t.id === this.activeTaskId);
|
||||
if (task) {
|
||||
task.isActive = false;
|
||||
// Reset actual time when manually stopping (not after a break)
|
||||
// This allows starting fresh next time
|
||||
task.actualMinutes = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user