pl-hooks: actually improve useInstance behavior

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-10-26 19:56:53 +02:00
parent 36cc2e103a
commit ad7527bd4d

View file

@ -11,12 +11,12 @@ const useInstance = () => {
const { client } = usePlHooksApiClient();
const queryClient = usePlHooksQueryClient();
return useQuery({
const query = useQuery({
queryKey: ['instance'],
queryFn: client.instance.getInstance,
initialData,
initialDataUpdatedAt: -1,
}, queryClient);
return { ...query, data: query.data || initialData };
};
export { useInstance };