mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 11:39:26 +01:00
15 lines
489 B
TypeScript
15 lines
489 B
TypeScript
import api from "~/lib/api"
|
|
import { CheckLatestVersionResult } from "../../types/system"
|
|
import { useQuery } from "@tanstack/react-query"
|
|
|
|
|
|
export const useUpdateAvailable = () => {
|
|
const queryData = useQuery<CheckLatestVersionResult | undefined>({
|
|
queryKey: ['system-update-available'],
|
|
queryFn: () => api.checkLatestVersion(),
|
|
refetchInterval: Infinity, // Disable automatic refetching
|
|
refetchOnWindowFocus: false,
|
|
})
|
|
|
|
return queryData.data
|
|
} |