Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit 49f6803

Browse files
authored
fix: fix service limit after middlenight (#96)
1 parent 72c3aaa commit 49f6803

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

packages/core/src/lib/time-tracking/timer/timer.service.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,23 @@ export class TimerService {
594594
true
595595
);
596596
lastLog.isRunning = false;
597+
598+
if (weeklyLimitStatus.remainWeeklyTime <= 5 && lastLogStopped) {
599+
lastLog = await this.startTimer({
600+
tenantId,
601+
organizationId,
602+
projectId: lastLog.projectId,
603+
taskId: lastLog.taskId,
604+
description: lastLog.description,
605+
logType: lastLog.logType,
606+
source: lastLog.source,
607+
isBillable: lastLog.isBillable,
608+
startedAt: now.toDate(),
609+
timeZone: request?.timeZone
610+
});
611+
// Update flag: timer is running again
612+
lastLogStopped = false;
613+
}
597614
} else if (remainingWeeklyLimit <= 21 * 60) {
598615
// Less than 21 minutes remaining → schedule a single socket event
599616
const existingTimeout = runningWeeklyLimitTimeouts.get(employeeId);

packages/ui-core/shared/src/lib/time-tracker/time-tracker/time-tracker.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ export class TimeTrackerComponent implements OnInit, OnDestroy {
278278
if (this.limitReached) {
279279
this.timeTrackerService.turnOffTimer();
280280
this.isDisable = true;
281+
this.triggerCheckStatus();
281282
} else {
282283
this.isDisable = false;
283284
}

0 commit comments

Comments
 (0)