Do not display only "Older" period

pull/6003/head
Chocobozzz 2023-10-11 11:56:03 +02:00
parent e2c7e58f42
commit 13f07161f5
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 7 additions and 0 deletions

View File

@ -281,6 +281,8 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
} }
] ]
let onlyOlderPeriod = true
for (const video of this.videos) { for (const video of this.videos) {
const publishedDate = video.publishedAt const publishedDate = video.publishedAt
@ -290,6 +292,8 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
if (currentGroupedDate <= period.value && period.validator(publishedDate)) { if (currentGroupedDate <= period.value && period.validator(publishedDate)) {
if (currentGroupedDate !== period.value) { if (currentGroupedDate !== period.value) {
if (period.value !== GroupDate.OLDER) onlyOlderPeriod = false
currentGroupedDate = period.value currentGroupedDate = period.value
this.groupedDates[video.id] = currentGroupedDate this.groupedDates[video.id] = currentGroupedDate
} }
@ -298,6 +302,9 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {
} }
} }
} }
// No need to group by date, there is only "Older" period available
if (onlyOlderPeriod) this.groupedDates = {}
} }
getCurrentGroupedDateLabel (video: Video) { getCurrentGroupedDateLabel (video: Video) {