Prevents autoresume on a manually paused stopwatch

main 1.8.7
isark 1 year ago
parent 3bbb50123a
commit 66a738389c

@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "Nothing", "productName": "Nothing",
"version": "1.8.6" "version": "1.8.7"
}, },
"tauri": { "tauri": {
"systemTray": { "systemTray": {

@ -300,11 +300,16 @@ export class TimeTrackerService {
if (!this.currentRunHistory) return; if (!this.currentRunHistory) return;
if (this.configService.config.enableStopwatch) { if (this.configService.config.enableStopwatch) {
if (!this.start || this.resumeOnNext) { if(!this.isActive && this.resumeOnNext) {
this.resumeOnNext = false; this.resumeOnNext = false;
this.startStopwatch(); this.startStopwatch();
} }
if(!this.isActive && !this.resumeOnNext) {
//Don't start timer if not meant to auto resumes on next.
return;
}
this.pushSubject.next({ this.pushSubject.next({
type: EntryType.ZoneEnter, type: EntryType.ZoneEnter,
zone: zone, zone: zone,
@ -330,6 +335,7 @@ export class TimeTrackerService {
case Resume.Discard: case Resume.Discard:
this.setCurrentRunHistory(this.createNew(plan.name)); this.setCurrentRunHistory(this.createNew(plan.name));
plan.last_stored_time = this.currentRunHistory!.uuid; plan.last_stored_time = this.currentRunHistory!.uuid;
this.resumeOnNext = true;
plan.requestSelfSave(); plan.requestSelfSave();
break; break;
} }

@ -37,8 +37,6 @@
<td mat-cell *matCellDef="let entry"> {{entry.estimatedTimeSpent}} </td> <td mat-cell *matCellDef="let entry"> {{entry.estimatedTimeSpent}} </td>
</ng-container> </ng-container>
<ng-container matColumnDef="aggregateFirstEntry"> <ng-container matColumnDef="aggregateFirstEntry">
<th mat-header-cell *matHeaderCellDef> Time of first entry </th> <th mat-header-cell *matHeaderCellDef> Time of first entry </th>
<td mat-cell *matCellDef="let entry"> {{entry.aggregateFirstEntry}} </td> <td mat-cell *matCellDef="let entry"> {{entry.aggregateFirstEntry}} </td>

Loading…
Cancel
Save