Fixed a issue where stop did not reset the timer
This commit is contained in:
10
main.ts
10
main.ts
@@ -132,6 +132,16 @@ export default class TaskWeaverPlugin extends Plugin {
|
||||
await this.saveSettings();
|
||||
}
|
||||
|
||||
async stopTaskTimer(taskId: string): Promise<void> {
|
||||
const task = this.settings.tasks.find(t => t.id === taskId);
|
||||
if (!task) return;
|
||||
|
||||
task.startTime = null;
|
||||
task.totalElapsed = 0;
|
||||
|
||||
await this.saveSettings();
|
||||
}
|
||||
|
||||
async toggleTaskComplete(taskId: string): Promise<void> {
|
||||
const task = this.settings.tasks.find(t => t.id === taskId);
|
||||
if (!task) return;
|
||||
|
||||
Reference in New Issue
Block a user