From ad7527bd4de307cdb2cc0742a20d085665d27087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 26 Oct 2024 19:56:53 +0200 Subject: [PATCH] pl-hooks: actually improve useInstance behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-hooks/lib/hooks/instance/use-instance.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pl-hooks/lib/hooks/instance/use-instance.ts b/packages/pl-hooks/lib/hooks/instance/use-instance.ts index 1348b3396..fcadcf90f 100644 --- a/packages/pl-hooks/lib/hooks/instance/use-instance.ts +++ b/packages/pl-hooks/lib/hooks/instance/use-instance.ts @@ -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 };