Update useAppVersion.tsx

This commit is contained in:
Nate Kelley 2025-09-22 21:44:39 -06:00
parent 75e7506dde
commit 5b3b4ed829
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 6 additions and 2 deletions

View File

@ -4,5 +4,5 @@ import { getAppBuildId } from '@/api/server-functions/getAppVersion';
export const versionGetAppVersion = queryOptions({
queryKey: ['app-version'] as const,
queryFn: getAppBuildId,
refetchInterval: 20000, // 20 seconds
refetchInterval: 30000, // 30 seconds
});

View File

@ -14,7 +14,11 @@ const checkNewVersion = (buildId: string | undefined): boolean => {
export const useAppVersion = () => {
const { openInfoNotification } = useBusterNotifications();
const { data, refetch, isFetched } = useQuery(versionGetAppVersion);
const { data, refetch } = useQuery({
...versionGetAppVersion,
refetchOnReconnect: true,
refetchOnMount: true,
});
const isChanged = checkNewVersion(data?.buildId);
const reloadWindow = () => {