diff --git a/packages/hooks/rakki/useRakkiTicketsByUser.ts b/packages/hooks/rakki/useRakkiTicketsByUser.ts index 56c6c5e82..9894c09ec 100644 --- a/packages/hooks/rakki/useRakkiTicketsByUser.ts +++ b/packages/hooks/rakki/useRakkiTicketsByUser.ts @@ -37,7 +37,7 @@ export const useRakkiTicketsCountByUser = (userId?: string) => { ); return await client.ticketsCountByUser({ userAddr: userAddress }); }, - { staleTime: Infinity, refetchInterval: 10000 }, + { staleTime: Infinity, refetchInterval: 10000, enabled: !!userId }, ); return { ticketsCount, ...other }; }; diff --git a/packages/screens/Rakki/components/BuyTickets/BuyTicketsButton.tsx b/packages/screens/Rakki/components/BuyTickets/BuyTicketsButton.tsx index dca6a0ec5..4262f79b0 100644 --- a/packages/screens/Rakki/components/BuyTickets/BuyTicketsButton.tsx +++ b/packages/screens/Rakki/components/BuyTickets/BuyTicketsButton.tsx @@ -1,5 +1,4 @@ -import Long from "long"; -import { FC, useEffect, useState } from "react"; +import { FC, useState } from "react"; import { View } from "react-native"; import { BrandText } from "@/components/BrandText"; @@ -16,14 +15,6 @@ export const BuyTicketsButton: FC<{ networkId: string; info: Info }> = ({ }) => { const [isButtonHovered, setButtonHovered] = useState(false); const [isModalVisible, setModalVisible] = useState(false); - const remainingTickets = info.config.max_tickets - info.current_tickets_count; - const [ticketAmount, setTicketAmount] = useState("1"); - const ticketAmountNumber = Long.fromString(ticketAmount || "0"); - useEffect(() => { - if (remainingTickets > 0 && ticketAmountNumber.gt(remainingTickets)) { - setTicketAmount(remainingTickets.toString()); - } - }, [ticketAmountNumber, remainingTickets]); return (