How to conditionally call useLiveQuery - TanStack