-
-

- @if (xtreamStore.selectedItem()) { - - } @else { + @if (!xtreamStore.selectedItem()) { +
+

- } - {{ getContentLabel() }} -

-
-
+ {{ getContentLabel() }} +

+
+ } +
diff --git a/apps/web/src/app/xtream-tauri/xtream-main-container.component.scss b/apps/web/src/app/xtream-tauri/xtream-main-container.component.scss index 441671e33..fdda915f4 100644 --- a/apps/web/src/app/xtream-tauri/xtream-main-container.component.scss +++ b/apps/web/src/app/xtream-tauri/xtream-main-container.component.scss @@ -49,4 +49,9 @@ .scrollable-content { flex: 1; overflow-y: auto; + + &.no-header { + // When header is hidden, content starts from top + margin-top: 0; + } } diff --git a/apps/web/src/app/xtream-tauri/xtream-main-container.component.ts b/apps/web/src/app/xtream-tauri/xtream-main-container.component.ts index 1306998a7..4f3c30429 100644 --- a/apps/web/src/app/xtream-tauri/xtream-main-container.component.ts +++ b/apps/web/src/app/xtream-tauri/xtream-main-container.component.ts @@ -38,6 +38,10 @@ export class XtreamMainContainerComponent implements OnInit { categoryClicked(category: XtreamCategory) { const categoryId = (category as any).category_id ?? category.id; + + // Clear any selected item when switching categories + this.xtreamStore.setSelectedItem(null); + this.xtreamStore.setSelectedCategory(Number(categoryId)); this.router.navigate([categoryId], { @@ -58,7 +62,10 @@ export class XtreamMainContainerComponent implements OnInit { : 'Category Content'; // Show page number when viewing category content (not detail view) - if (!this.xtreamStore.selectedItem() && this.xtreamStore.getTotalPages() > 1) { + if ( + !this.xtreamStore.selectedItem() && + this.xtreamStore.getTotalPages() > 1 + ) { const currentPage = this.xtreamStore.page() + 1; // +1 because page is 0-indexed const totalPages = this.xtreamStore.getTotalPages(); const pageLabel = this.translateService.instant('PORTALS.PAGE');