General Bugfixes

This commit is contained in:
2025-11-23 15:33:51 +01:00
parent 2800a7507e
commit c8f5c69102
3 changed files with 20 additions and 2 deletions

View File

@@ -719,6 +719,8 @@ var FocusTaskPlugin = class extends import_obsidian3.Plugin {
const now = Date.now();
const elapsedMs = now - this.timerStartTimestamp;
const elapsedSeconds = Math.floor(elapsedMs / 1e3);
if (elapsedSeconds < 1)
return;
if (this.isBreakMode) {
this.currentTimerSeconds = Math.max(0, this.pausedTimeRemaining - elapsedSeconds);
if (this.currentTimerSeconds <= 0) {
@@ -743,6 +745,8 @@ var FocusTaskPlugin = class extends import_obsidian3.Plugin {
this.focusSecondsToday += elapsedSeconds;
}
}
this.timerStartTimestamp = now;
this.pausedTimeRemaining = this.currentTimerSeconds;
this.updateStatusBar();
this.updateTimerDisplay();
this.saveAllData();
@@ -899,6 +903,7 @@ var FocusTaskPlugin = class extends import_obsidian3.Plugin {
const task = this.data.tasks.find((t) => t.id === this.activeTaskId);
if (task) {
task.isActive = false;
task.actualMinutes = 0;
}
}
this.isTimerRunning = false;