diff --git a/web/src/lib/managers/timeline-manager/timeline-manager.svelte.ts b/web/src/lib/managers/timeline-manager/timeline-manager.svelte.ts index 38c593bd00cc9..c6142f99e1f31 100644 --- a/web/src/lib/managers/timeline-manager/timeline-manager.svelte.ts +++ b/web/src/lib/managers/timeline-manager/timeline-manager.svelte.ts @@ -455,13 +455,15 @@ export class TimelineManager extends VirtualScrollManager { } protected upsertSegmentForAsset(asset: TimelineAsset) { - let month = getMonthGroupByDate(this, asset.localDateTime); + const { year, month } = asset.localDateTime; + const yearMonth: TimelineYearMonth = { year, month }; + let month_ = getMonthGroupByDate(this, yearMonth); - if (!month) { - month = new MonthGroup(this, asset.localDateTime, 1, true, this.#options.order); - this.months.push(month); + if (!month_) { + month_ = new MonthGroup(this, yearMonth, 1, true, this.#options.order); + this.months.push(month_); } - return month; + return month_; } /**