|
@@ -70,7 +70,7 @@ export const BalanceContent = (props: { wallet: Wallet }) => {
|
|
|
|
|
|
export const BonusContent = (props: { wallet: Wallet; handleAcquire?: any }) => {
|
|
|
const { wallet, handleAcquire } = props;
|
|
|
- const [switchValue, setSwitchValue] = React.useState<boolean>(false);
|
|
|
+ const [switchValue, setSwitchValue] = React.useState<boolean>(wallet.is_open_no_bonus || false);
|
|
|
const [isLoading, setIsLoading] = React.useState<boolean>(false);
|
|
|
const t = useTranslations("ProfilePage");
|
|
|
|
|
@@ -92,7 +92,6 @@ export const BonusContent = (props: { wallet: Wallet; handleAcquire?: any }) =>
|
|
|
if (!(res?.code && res?.data?.code === 0)) {
|
|
|
throw new Error("error");
|
|
|
}
|
|
|
-
|
|
|
setSwitchValue(value);
|
|
|
} finally {
|
|
|
setIsLoading(false);
|
|
@@ -120,7 +119,7 @@ export const BonusContent = (props: { wallet: Wallet; handleAcquire?: any }) =>
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
- //toggleUserBounsApi
|
|
|
+
|
|
|
return (
|
|
|
<div>
|
|
|
<WalletContent
|