refactor(xtream): enhance error handling for empty categories and no category selected

This commit is contained in:
4gray committed 2025-05-04 23:06:30 +02:00
1 parent c1d7a3c155
commit 818e729c75
2 files changed
+30 -8

No files matched your search

@@ -37,14 +37,34 @@
<div class="title">{{ i.title || 'No name' }}</div>
</mat-card-actions>
</mat-card>
} @empty {
<app-playlist-error-view
[title]="'PORTALS.ERROR_VIEW.EMPTY_CATEGORY.TITLE' | translate"
[description]="
'PORTALS.ERROR_VIEW.EMPTY_CATEGORY.DESCRIPTION' | translate
"
[showActionButtons]="false"
[viewType]="'EMPTY_CATEGORY'"
/>
}
</div>
<mat-paginator
[length]="totalPages() * limit()"
[pageSize]="limit()"
[pageSizeOptions]="pageSizeOptions"
(page)="onPageChange($event)"
aria-label="Select page"
@if (paginatedContent().length > 0) {
<mat-paginator
[length]="totalPages() * limit()"
[pageSize]="limit()"
[pageSizeOptions]="pageSizeOptions"
(page)="onPageChange($event)"
aria-label="Select page"
/>
}
} @else {
<app-playlist-error-view
[title]="'PORTALS.ERROR_VIEW.NO_CATEGORY_SELECTED.TITLE' | translate"
[description]="
'PORTALS.ERROR_VIEW.NO_CATEGORY_SELECTED.DESCRIPTION' | translate
"
[showActionButtons]="false"
[viewType]="'EMPTY_CATEGORY'"
/>
}
@@ -5,7 +5,8 @@ import { MatIcon } from '@angular/material/icon';
import { MatPaginatorModule, PageEvent } from '@angular/material/paginator';
import { MatTooltip } from '@angular/material/tooltip';
import { ActivatedRoute, Router } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';
import { TranslatePipe } from '@ngx-translate/core';
import { PlaylistErrorViewComponent } from '../playlist-error-view/playlist-error-view.component';
import { XtreamStore } from '../xtream.store';
@Component({
@@ -18,7 +19,8 @@ import { XtreamStore } from '../xtream.store';
MatPaginatorModule,
MatTooltip,
NgOptimizedImage,
TranslateModule,
PlaylistErrorViewComponent,
TranslatePipe,
],
})
export class CategoryContentViewComponent {