|
@@ -86,6 +86,11 @@ const Jackpot: React.FC = () => {
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, []);
|
|
}, []);
|
|
|
|
|
|
|
|
+ const isDisabled = React.useMemo(() => {
|
|
|
|
+ if (!(infoData?.reward && infoData?.reward > 0)) return true;
|
|
|
|
+ return !(curTabData?.is_unlock && !curTabData.is_suss);
|
|
|
|
+ }, [curTabData, infoData]);
|
|
|
|
+
|
|
const getInfoData = async () => {
|
|
const getInfoData = async () => {
|
|
if (!activeId) return;
|
|
if (!activeId) return;
|
|
try {
|
|
try {
|
|
@@ -137,7 +142,7 @@ const Jackpot: React.FC = () => {
|
|
};
|
|
};
|
|
|
|
|
|
const doClaim = async () => {
|
|
const doClaim = async () => {
|
|
- if (!(curTabData?.is_unlock && !curTabData.is_suss)) return;
|
|
|
|
|
|
+ if (isDisabled) return;
|
|
try {
|
|
try {
|
|
const res = await claimActivityReward({
|
|
const res = await claimActivityReward({
|
|
activity_id: Number(activeId),
|
|
activity_id: Number(activeId),
|
|
@@ -246,7 +251,7 @@ const Jackpot: React.FC = () => {
|
|
<div className={clsx("mt-[.2rem] flex flex-row justify-center")}>
|
|
<div className={clsx("mt-[.2rem] flex flex-row justify-center")}>
|
|
<div
|
|
<div
|
|
className={clsx(styles.btn, {
|
|
className={clsx(styles.btn, {
|
|
- [styles.disabled]: !(!curTabData.is_suss && curTabData.is_unlock),
|
|
|
|
|
|
+ [styles.disabled]: isDisabled,
|
|
})}
|
|
})}
|
|
onClick={doClaim}
|
|
onClick={doClaim}
|
|
>
|
|
>
|