mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
add: agent update notifier, pagination
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import {useQuery} from "@tanstack/react-query";
|
||||
import {getNewAgentRelease} from "@/features/updates/services/github";
|
||||
|
||||
export const useAgentUpdateCheck = (currentVersion?: string | null) => {
|
||||
const {data: newRelease, isLoading} = useQuery({
|
||||
queryKey: ["agent-new-release", currentVersion],
|
||||
queryFn: () => currentVersion ? getNewAgentRelease(currentVersion) : Promise.resolve(null),
|
||||
staleTime: 1000 * 60 * 60,
|
||||
enabled: !!currentVersion,
|
||||
});
|
||||
|
||||
return {
|
||||
newRelease,
|
||||
isLoading,
|
||||
isUpdateAvailable: !!newRelease,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user