@opexa/portal-components 0.0.1103 → 0.0.1105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,21 @@
1
- import { useInfiniteQuery } from '@tanstack/react-query';
1
+ import { useInfiniteQuery, useQueryClient } from '@tanstack/react-query';
2
+ import { useEffect } from 'react';
2
3
  import { getJackpotsNext } from '../../services/report.js';
3
4
  import { getJackpotsNextQueryKey } from '../../utils/queryKeys.js';
5
+ import { useSessionQuery } from './useSessionQuery.js';
4
6
  export const useJackpotsNextQuery = (input, config) => {
7
+ const queryClient = useQueryClient();
8
+ const sessionQuery = useSessionQuery();
9
+ // biome-ignore lint/correctness/useExhaustiveDependencies: intentionally only re-runs on session status change; input is stable per call site and queryClient is stable from useQueryClient
10
+ useEffect(() => {
11
+ if (sessionQuery.data?.status === 'authenticated') {
12
+ queryClient.invalidateQueries({
13
+ queryKey: getJackpotsNextQueryKey(input),
14
+ });
15
+ }
16
+ }, [sessionQuery.data?.status]);
5
17
  const query = useInfiniteQuery({
6
- refetchOnMount: false,
7
- refetchOnReconnect: false,
8
- refetchOnWindowFocus: false,
18
+ staleTime: 0,
9
19
  ...config,
10
20
  queryKey: getJackpotsNextQueryKey(input),
11
21
  queryFn: ({ pageParam, signal }) => {
@@ -17,9 +17,6 @@ export const useJackpotsQuery = (input, config) => {
17
17
  }
18
18
  }, [sessionQuery.data?.status]);
19
19
  const query = useInfiniteQuery({
20
- refetchOnMount: false,
21
- refetchOnReconnect: false,
22
- refetchOnWindowFocus: false,
23
20
  staleTime: 0,
24
21
  ...config,
25
22
  queryKey: getJackpotsQueryKey(input),
@@ -13,7 +13,7 @@ const JackpotsListItemDesktop = dynamic(() => import('./JackpotsListItemDesktop.
13
13
  const JackpotsListItemMobile = dynamic(() => import('./JackpotsListItemMobile.js').then((mod) => mod.JackpotsListItemMobile));
14
14
  export function JackpotsListNext(props) {
15
15
  const jackpotsNextQuery = useJackpotsNextQuery({
16
- first: 25,
16
+ first: 100,
17
17
  filter: {
18
18
  deleted: {
19
19
  equal: false,
@@ -14,7 +14,6 @@ export const prefetchJackpotsQuery = cache(async (input) => {
14
14
  }, { signal });
15
15
  },
16
16
  initialPageParam: undefined,
17
- staleTime: 5 * 60 * 1000,
18
17
  })
19
18
  .catch(() => log.text("'prefetchJackpotsQuery' failed", 'error'));
20
19
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.1103",
3
+ "version": "0.0.1105",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",