Skip to content

Commit

Permalink
update enabled variable (#3469)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattupham authored Jul 8, 2024
1 parent 2a4c5ff commit b28f8b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/web/hooks/queries/osmosis/use-icns-name.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { queryICNSName } from "@osmosis-labs/server";
import { useQuery } from "@tanstack/react-query";

import { IS_TESTNET } from "~/config";
import { ChainList } from "~/config/generated/chain-list";

export const useICNSName = ({ address }: { address: string }) => {
const enabled =
!!IS_TESTNET && Boolean(address) && typeof address === "string";

return useQuery({
queryKey: ["icns-name", address],
queryFn: () => queryICNSName({ address, chainList: ChainList }),
enabled: Boolean(address) && typeof address === "string",
enabled,
select: ({ data: { names, primary_name } }) => {
return {
names: names,
Expand Down

0 comments on commit b28f8b8

Please sign in to comment.