mirror of https://github.com/buster-so/buster.git
Update useAppVersion.tsx
This commit is contained in:
parent
75e7506dde
commit
5b3b4ed829
|
@ -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
|
||||
});
|
||||
|
|
|
@ -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 = () => {
|
||||
|
|
Loading…
Reference in New Issue