feat(stalker): expired account view for stalker portals

This commit is contained in:
4gray committed 2024-01-02 19:49:04 +01:00
1 parent 19f4951984
commit edbdeca951
3 files changed
+60 -36

No files matched your search

+1
View File
@@ -21,6 +21,7 @@ data.db
preload.js
shared/*.js
playwright-report
.nx
# dependencies
/node_modules
@@ -13,36 +13,46 @@
(favoritesClicked)="favoritesClicked()"
/>
<app-category-view
*ngIf="currentLayout === 'category'"
(categoryClicked)="categoryClicked($event)"
[items]="items"
/>
<app-category-content-view
*ngIf="currentLayout === 'category_content'"
[items]="items"
(itemClicked)="itemClicked($event)"
/>
<app-vod-details
*ngIf="currentLayout === 'vod-details'"
[item]="itemDetails"
(playClicked)="playVod()"
(addToFavoritesClicked)="addToFavorites($event)"
(removeFromFavoritesClicked)="removeFromFavorites($event)"
/>
<app-category-content-view
*ngIf="currentLayout === 'favorites'"
[items]="favorites$ | async"
(itemClicked)="itemClicked($event)"
/>
<mat-paginator
*ngIf="currentLayout === 'category_content'"
[length]="length"
[pageSize]="pageSize"
(page)="handlePageChange($event)"
aria-label="Select page"
/>
@switch (currentLayout) {
@case ('category') {
<app-category-view
(categoryClicked)="categoryClicked($event)"
[items]="items"
/>
}
@case ('category_content') {
<app-category-content-view
[items]="items"
(itemClicked)="itemClicked($event)"
/>
<mat-paginator
*ngIf="currentLayout === 'category_content'"
[length]="length"
[pageSize]="pageSize"
(page)="handlePageChange($event)"
aria-label="Select page"
/>
}
@case ('vod-details') {
<app-vod-details
[item]="itemDetails"
(playClicked)="playVod()"
(addToFavoritesClicked)="addToFavorites($event)"
(removeFromFavoritesClicked)="removeFromFavorites($event)"
/>
}
@case ('favorites') {
<app-category-content-view
[items]="favorites$ | async"
(itemClicked)="itemClicked($event)"
/>
}
@case ('not-available') {
<app-playlist-error-view
[title]="'PORTALS.ACCOUNT_EXPIRED_VIEW.TITLE' | translate"
[description]="
'PORTALS.ACCOUNT_EXPIRED_VIEW.DESCRIPTION' | translate
"
/>
}
}
@@ -6,6 +6,7 @@ import { MatPaginatorModule, PageEvent } from '@angular/material/paginator';
import { MatSnackBar } from '@angular/material/snack-bar';
import { Store } from '@ngrx/store';
import { StorageMap } from '@ngx-pwa/local-storage';
import { TranslateModule } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { IpcCommand } from '../../../shared/ipc-command.class';
import {
@@ -29,6 +30,7 @@ import { ContentTypeNavigationItem } from '../xtream/content-type-navigation-ite
import { ContentType } from '../xtream/content-type.enum';
import { NavigationBarComponent } from '../xtream/navigation-bar/navigation-bar.component';
import { PlayerDialogComponent } from '../xtream/player-dialog/player-dialog.component';
import { PlaylistErrorViewComponent } from '../xtream/playlist-error-view/playlist-error-view.component';
import { PortalStore } from '../xtream/portal.store';
import { VodDetailsComponent } from '../xtream/vod-details/vod-details.component';
import { StalkerContentTypes } from './stalker-content-types';
@@ -44,6 +46,8 @@ import { StalkerContentTypes } from './stalker-content-types';
NavigationBarComponent,
NgIf,
MatPaginatorModule,
PlaylistErrorViewComponent,
TranslateModule,
VodDetailsComponent,
],
})
@@ -53,7 +57,12 @@ export class StalkerMainContainerComponent implements OnInit {
listeners = [];
isLoading = true;
selectedContentType: ContentType = ContentType.VODS;
currentLayout = 'category';
currentLayout:
| 'category'
| 'category_content'
| 'favorites'
| 'vod-details'
| 'not-available' = 'category';
searchPhrase = this.portalStore.searchPhrase();
settings = toSignal(
this.storage.get(STORE_KEY.Settings)
@@ -97,8 +106,12 @@ export class StalkerMainContainerComponent implements OnInit {
new IpcCommand(STALKER_RESPONSE, (response: any) =>
this.handleResponse(response)
),
new IpcCommand(ERROR, (response: { message: string; status: number }) =>
this.showErrorAsNotification(response)
new IpcCommand(
ERROR,
(response: { message: string; status: number }) => {
this.currentLayout = 'not-available';
this.showErrorAsNotification(response);
}
),
];