refactor: enhance params handling in recently viewed and favorites components

This commit is contained in:
4gray committed 2026-02-07 23:08:56 +01:00
1 parent ed9e85f5e8
commit a72fb31d7a
2 files changed
+20 -14

No files matched your search

@@ -47,13 +47,16 @@ export class RecentlyViewedComponent {
readonly currentPlaylist = this.stalkerStore.currentPlaylist;
readonly allFavorites = rxResource({
params: () => ({
refreshTimestamp: this.refreshTimestamp(),
}),
stream: () =>
this.playlistService.getPortalRecentlyViewed(
this.stalkerStore.currentPlaylist()?._id
),
params: () => {
const portalId = this.stalkerStore.currentPlaylist()?._id;
if (!portalId) return undefined;
return {
portalId,
refreshTimestamp: this.refreshTimestamp(),
};
},
stream: ({ params }) =>
this.playlistService.getPortalRecentlyViewed(params.portalId),
});
readonly categories = computed(() => [
@@ -47,13 +47,16 @@ export class StalkerFavoritesComponent {
readonly currentPlaylist = this.stalkerStore.currentPlaylist;
readonly allFavorites = rxResource({
params: () => ({
refreshTimestamp: this.refreshTimestamp(),
}),
stream: () =>
this.playlistService.getPortalFavorites(
this.stalkerStore.currentPlaylist()?._id
),
params: () => {
const portalId = this.stalkerStore.currentPlaylist()?._id;
if (!portalId) return undefined;
return {
portalId,
refreshTimestamp: this.refreshTimestamp(),
};
},
stream: ({ params }) =>
this.playlistService.getPortalFavorites(params.portalId),
});
readonly categories = computed(() => [