feat(schedule): refresh current time badge too

This commit is contained in:
Johannes Millan 2025-10-21 16:29:35 +02:00
parent 58a10b12a6
commit 763b201dad
3 changed files with 6 additions and 6 deletions

View file

@ -122,8 +122,8 @@ export class ScheduleDayPanelComponent implements AfterViewInit, OnDestroy {
});
currentTimeRow = computed(() => {
// Trigger re-computation via today change
this._todayDateStr();
// Trigger re-computation every 2 minutes
this._scheduleService.scheduleRefreshTick();
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes();

View file

@ -42,13 +42,13 @@ export class ScheduleService {
private _icalEvents = toSignal(this._calendarIntegrationService.icalEvents$, {
initialValue: [],
});
private _scheduleRefreshTick = toSignal(interval(2 * 60 * 1000).pipe(startWith(0)), {
scheduleRefreshTick = toSignal(interval(2 * 60 * 1000).pipe(startWith(0)), {
initialValue: 0,
});
createScheduleDaysComputed(daysToShow: Signal<string[]>): Signal<ScheduleDay[]> {
return computed(() => {
this._scheduleRefreshTick();
this.scheduleRefreshTick();
const timelineTasks = this._timelineTasks();
const taskRepeatCfgs = this._taskRepeatCfgs();
const timelineCfg = this._timelineConfig();

View file

@ -141,8 +141,8 @@ export class ScheduleComponent implements AfterViewInit {
beyondBudget = computed(() => this._eventsAndBeyondBudget().beyondBudgetDays);
currentTimeRow = computed(() => {
// Trigger re-computation
this.scheduleDays();
// Trigger re-computation every 2 minutes
this.scheduleService.scheduleRefreshTick();
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes();