Skip to content

Commit

Permalink
feat(web): auto refresh dashboard stats (#1490)
Browse files Browse the repository at this point in the history
* feat(web): refresh interval for stats and activity tables

* feat(web): refresh stats and activity tables on switching back to autobrr tab
  • Loading branch information
martylukyy committed Apr 8, 2024
1 parent 5077829 commit f1b4214
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions web/src/api/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,25 @@ export const ReleasesListQueryOptions = (offset: number, limit: number, filters:
queryOptions({
queryKey: ReleaseKeys.list(offset, limit, filters),
queryFn: () => APIClient.release.findQuery(offset, limit, filters),
staleTime: 5000
staleTime: 5000,
refetchOnWindowFocus: true,
refetchInterval: 15000 // refetch releases table on releases page every 15s
});

export const ReleasesLatestQueryOptions = () =>
queryOptions({
queryKey: ReleaseKeys.latestActivity(),
queryFn: () => APIClient.release.findRecent(),
refetchOnWindowFocus: false
refetchOnWindowFocus: true,
refetchInterval: 15000 // refetch recent activity table on dashboard page every 15s
});

export const ReleasesStatsQueryOptions = () =>
queryOptions({
queryKey: ReleaseKeys.stats(),
queryFn: () => APIClient.release.stats(),
refetchOnWindowFocus: false
refetchOnWindowFocus: true,
refetchInterval: 15000 // refetch stats on dashboard page every 15s
});

// ReleasesIndexersQueryOptions get basic list of used indexers by identifier
Expand Down

0 comments on commit f1b4214

Please sign in to comment.