mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #4334 from omnivore-app/fix/web-article-fetch
Prevent fetching article before router params have been read
This commit is contained in:
commit
c6d978e379
1 changed files with 5 additions and 1 deletions
|
|
@ -677,10 +677,14 @@ export function useRefreshProcessingItems() {
|
|||
return mutation
|
||||
}
|
||||
|
||||
export const useGetLibraryItemContent = (username: string, slug: string) => {
|
||||
export const useGetLibraryItemContent = (
|
||||
username: string | undefined,
|
||||
slug: string | undefined
|
||||
) => {
|
||||
const queryClient = useQueryClient()
|
||||
return useQuery({
|
||||
queryKey: ['libraryItem', slug],
|
||||
enabled: !!username && !!slug,
|
||||
queryFn: async () => {
|
||||
const response = (await gqlFetcher(GQL_GET_LIBRARY_ITEM_CONTENT, {
|
||||
slug,
|
||||
|
|
|
|||
Loading…
Reference in a new issue