Skip to content

Commit

Permalink
only show hypercerts for current chain in hypercerts overview
Browse files Browse the repository at this point in the history
  • Loading branch information
Jipperism committed Jan 16, 2024
1 parent 4d6220f commit 024a95e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions hooks/useFetchAllCollections.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
import { useQuery } from "@tanstack/react-query";
import { supabase } from "@/lib/supabase";
import { useChainId } from "wagmi";

export const useFetchAllCollections = () => {
return useQuery(["collections", "all"], async () => {
return supabase.from("registries").select("*, claims(*)");
});
const chainId = useChainId();
return useQuery(
["collections", "all"],
async () => {
return supabase
.from("registries")
.select("*, claims(*)")
.eq("chain_id", chainId);
},
{
enabled: !!chainId,
},
);
};

0 comments on commit 024a95e

Please sign in to comment.