From b6fd3a4f66bdf855db5473082da068d93fc84010 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Sat, 24 Dec 2022 21:15:56 -0800 Subject: [PATCH] Adjust cache/stale times for other home items --- .../features/home/routes/home-route.tsx | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/renderer/features/home/routes/home-route.tsx b/src/renderer/features/home/routes/home-route.tsx index bec2f006..26fac3d2 100644 --- a/src/renderer/features/home/routes/home-route.tsx +++ b/src/renderer/features/home/routes/home-route.tsx @@ -21,12 +21,18 @@ const HomeRoute = () => { recentlyPlayed: 0, }); - const feature = useAlbumList({ - limit: 20, - sortBy: AlbumListSort.RANDOM, - sortOrder: SortOrder.DESC, - startIndex: 0, - }); + const feature = useAlbumList( + { + limit: 20, + sortBy: AlbumListSort.RANDOM, + sortOrder: SortOrder.DESC, + startIndex: 0, + }, + { + cacheTime: 1000 * 60, + staleTime: 1000 * 60, + }, + ); const featureItemsWithImage = useMemo(() => { return feature.data?.items?.filter((item) => item.imageUrl) ?? []; @@ -68,7 +74,7 @@ const HomeRoute = () => { }, { keepPreviousData: true, - staleTime: 0, + staleTime: 1000 * 60, }, ); @@ -81,7 +87,7 @@ const HomeRoute = () => { }, { keepPreviousData: true, - staleTime: 0, + staleTime: 1000 * 60 * 60, }, );