Release v1.1.1: Critical timer bug fix
Fixed critical bug where actual time spent on tasks was being reset to 0 when resuming work after a break in Pomodoro mode. ## Bug Fix - Fixed timer actual time resetting to 0 when skipping break or resuming work - Added preserveActualTime parameter to stopTimer() function - Actual time now correctly accumulates across multiple Pomodoro sessions
This commit is contained in:
10
main.js
10
main.js
@@ -1287,7 +1287,7 @@ var ImmersePlugin = class extends import_obsidian4.Plugin {
|
||||
const task = this.data.tasks.find((t) => t.id === taskId);
|
||||
if (!task)
|
||||
return;
|
||||
this.stopTimer();
|
||||
this.stopTimer(true);
|
||||
this.activeTaskId = taskId;
|
||||
task.isActive = true;
|
||||
this.isBreakMode = false;
|
||||
@@ -1325,7 +1325,7 @@ var ImmersePlugin = class extends import_obsidian4.Plugin {
|
||||
const task = this.data.tasks.find((t) => t.id === taskId);
|
||||
if (!task)
|
||||
return;
|
||||
this.stopTimer();
|
||||
this.stopTimer(true);
|
||||
this.activeTaskId = taskId;
|
||||
task.isActive = true;
|
||||
this.isBreakMode = false;
|
||||
@@ -1446,7 +1446,7 @@ var ImmersePlugin = class extends import_obsidian4.Plugin {
|
||||
this.updateStatusBar();
|
||||
this.refreshView();
|
||||
}
|
||||
stopTimer() {
|
||||
stopTimer(preserveActualTime = false) {
|
||||
if (this.timerInterval) {
|
||||
window.clearInterval(this.timerInterval);
|
||||
this.timerInterval = null;
|
||||
@@ -1455,7 +1455,9 @@ var ImmersePlugin = class extends import_obsidian4.Plugin {
|
||||
const task = this.data.tasks.find((t) => t.id === this.activeTaskId);
|
||||
if (task) {
|
||||
task.isActive = false;
|
||||
task.actualMinutes = 0;
|
||||
if (!preserveActualTime) {
|
||||
task.actualMinutes = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.isTimerRunning = false;
|
||||
|
||||
Reference in New Issue
Block a user