|
@@ -65,22 +65,23 @@ const SignIn: FC = () => {
|
|
|
});
|
|
|
if (res.code === 200 && res?.data?.code === 1) {
|
|
|
getSignData({ activity_id });
|
|
|
+ const amountObj: any = {};
|
|
|
if (res?.data?.reward) {
|
|
|
- const amountObj: any = {};
|
|
|
res?.data?.reward.forEach((item: any) => {
|
|
|
amountObj[`coin_${item.coin_type}`] = formatAmount(item.amount);
|
|
|
});
|
|
|
//extra_reward
|
|
|
- res?.data?.reward.forEach((item: any) => {
|
|
|
+ }
|
|
|
+ if (res?.data?.extra_reward) {
|
|
|
+ res?.data?.extra_reward.forEach((item: any) => {
|
|
|
amountObj[`coin_${item.coin_type}`] = formatAmount(
|
|
|
new BigNumber(amountObj[`coin_${item.coin_type}`] || 0)
|
|
|
.plus(item.amount)
|
|
|
.toString()
|
|
|
);
|
|
|
});
|
|
|
- setAmount(amountObj);
|
|
|
}
|
|
|
-
|
|
|
+ setAmount(amountObj);
|
|
|
setVisible(true);
|
|
|
} else {
|
|
|
throw new Error(tCode(`code.400`));
|