diff --git a/src/features/dashboard/templates/list/constants.ts b/src/features/dashboard/templates/list/constants.ts index 6ccae133f..1e2082c5c 100644 --- a/src/features/dashboard/templates/list/constants.ts +++ b/src/features/dashboard/templates/list/constants.ts @@ -3,6 +3,8 @@ import type { TemplatesSort } from '@/core/modules/templates/models' export const TEMPLATES_PAGE_SIZE = 50 +export const TEMPLATES_REFETCH_INTERVAL_MS = 15_000 + export const TEMPLATES_DEFAULT_SORT_COLUMN_ID = 'updatedAt' export const TEMPLATES_DEFAULT_SORT_BASE = 'updated_at' export const TEMPLATES_DEFAULT_SORT_DESC = true diff --git a/src/features/dashboard/templates/list/table.tsx b/src/features/dashboard/templates/list/table.tsx index 5ec940906..5cce55730 100644 --- a/src/features/dashboard/templates/list/table.tsx +++ b/src/features/dashboard/templates/list/table.tsx @@ -35,6 +35,7 @@ import { TEMPLATES_DEFAULT_SORT_BASE, TEMPLATES_DEFAULT_SORT_DESC, TEMPLATES_PAGE_SIZE, + TEMPLATES_REFETCH_INTERVAL_MS, } from './constants' import TemplatesHeader from './header' import { useTemplateTableStore } from './stores/table-store' @@ -92,6 +93,9 @@ export default function TemplatesTable() { getNextPageParam: (lastPage) => lastPage.nextCursor ?? undefined, initialCursor: undefined, placeholderData: keepPreviousData, + refetchInterval: TEMPLATES_REFETCH_INTERVAL_MS, + refetchIntervalInBackground: false, + refetchOnWindowFocus: true, } ) )