diff --git a/apps/web/src/app/xtream-tauri/serial-details/serial-details.component.html b/apps/web/src/app/xtream-tauri/serial-details/serial-details.component.html
index c8ba7f125..3d3b50e1e 100644
--- a/apps/web/src/app/xtream-tauri/serial-details/serial-details.component.html
+++ b/apps/web/src/app/xtream-tauri/serial-details/serial-details.component.html
@@ -72,5 +72,7 @@
(episodeClicked)="playEpisode($event)"
/>
+} @else {
+
}
diff --git a/apps/web/src/app/xtream-tauri/stores/features/with-selection.feature.ts b/apps/web/src/app/xtream-tauri/stores/features/with-selection.feature.ts
index e9823b972..d86e80c13 100644
--- a/apps/web/src/app/xtream-tauri/stores/features/with-selection.feature.ts
+++ b/apps/web/src/app/xtream-tauri/stores/features/with-selection.feature.ts
@@ -17,6 +17,7 @@ export interface SelectionState {
selectedItem: any | null;
page: number;
limit: number;
+ isLoadingDetails: boolean;
}
/**
@@ -28,6 +29,7 @@ const initialSelectionState: SelectionState = {
selectedItem: null,
page: 0,
limit: Number(localStorage.getItem('xtream-page-size') ?? 25),
+ isLoadingDetails: false,
};
/**
@@ -242,6 +244,13 @@ export function withSelection() {
patchState(store, { selectedItem: item });
},
+ /**
+ * Set the loading details state
+ */
+ setIsLoadingDetails(isLoading: boolean): void {
+ patchState(store, { isLoadingDetails: isLoading });
+ },
+
/**
* Set the current page
*/
diff --git a/apps/web/src/app/xtream-tauri/stores/xtream.store.ts b/apps/web/src/app/xtream-tauri/stores/xtream.store.ts
index 1f2970700..25ed8d442 100644
--- a/apps/web/src/app/xtream-tauri/stores/xtream.store.ts
+++ b/apps/web/src/app/xtream-tauri/stores/xtream.store.ts
@@ -121,6 +121,7 @@ export const XtreamStore = signalStore(
const playlist = ngrxStore.selectSignal(selectActivePlaylist)();
if (!playlist) return;
+ store.setIsLoadingDetails(true);
dataService.fetchData(
`${playlist.serverUrl}/player_api.php`,
{
@@ -137,6 +138,8 @@ export const XtreamStore = signalStore(
});
}).catch((error: unknown) => {
console.error('Error fetching VOD details:', error);
+ }).finally(() => {
+ store.setIsLoadingDetails(false);
});
},
@@ -150,6 +153,7 @@ export const XtreamStore = signalStore(
const playlist = ngrxStore.selectSignal(selectActivePlaylist)();
if (!playlist) return;
+ store.setIsLoadingDetails(true);
dataService.fetchData(
`${playlist.serverUrl}/player_api.php`,
{
@@ -166,6 +170,8 @@ export const XtreamStore = signalStore(
});
}).catch((error: unknown) => {
console.error('Error fetching series details:', error);
+ }).finally(() => {
+ store.setIsLoadingDetails(false);
});
},
diff --git a/apps/web/src/app/xtream-tauri/vod-details/vod-details.component.html b/apps/web/src/app/xtream-tauri/vod-details/vod-details.component.html
index 5e4d95e5c..1eb060e2c 100644
--- a/apps/web/src/app/xtream-tauri/vod-details/vod-details.component.html
+++ b/apps/web/src/app/xtream-tauri/vod-details/vod-details.component.html
@@ -100,5 +100,7 @@
}
+} @else {
+
}
diff --git a/apps/web/src/app/xtream-tauri/xtream-main-container.component.html b/apps/web/src/app/xtream-tauri/xtream-main-container.component.html
index 5bf44186a..4831086df 100644
--- a/apps/web/src/app/xtream-tauri/xtream-main-container.component.html
+++ b/apps/web/src/app/xtream-tauri/xtream-main-container.component.html
@@ -24,7 +24,7 @@
- @if (!xtreamStore.selectedItem()) {
+ @if (!xtreamStore.selectedItem() && !xtreamStore.isLoadingDetails()) {