Fix claim rewards refresh bug

This commit is contained in:
Reckless_Satoshi 2022-05-22 13:56:07 -07:00
parent bf35961efb
commit 4bbb885ec6
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
5 changed files with 12 additions and 10 deletions

View File

@ -90,7 +90,7 @@ class BottomBar extends Component {
this.setState({openProfile: false}); this.setState({openProfile: false});
}; };
handleSubmitInvoiceClicked=(rewardInvoice)=>{ handleSubmitInvoiceClicked=(e, rewardInvoice)=>{
this.setState({ this.setState({
badInvoice:false, badInvoice:false,
showRewardsSpinner: true, showRewardsSpinner: true,
@ -112,6 +112,7 @@ class BottomBar extends Component {
withdrawn: data.successful_withdrawal ? true : false, withdrawn: data.successful_withdrawal ? true : false,
showRewardsSpinner: false, showRewardsSpinner: false,
})); }));
e.preventDefault();
} }
getHost(){ getHost(){

View File

@ -41,7 +41,7 @@ type Props = {
activeOrderId: string | number; activeOrderId: string | number;
lastOrderId: string | number; lastOrderId: string | number;
referralCode: string; referralCode: string;
handleSubmitInvoiceClicked: (invoice: string) => void; handleSubmitInvoiceClicked: (e:any, invoice: string) => void;
host: string; host: string;
showRewardsSpinner: boolean; showRewardsSpinner: boolean;
withdrawn: boolean; withdrawn: boolean;
@ -273,9 +273,9 @@ const ProfileDialog = ({
</Grid> </Grid>
</ListItemText> </ListItemText>
) : ( ) : (
<form style={{maxWidth: 270}}> <form noValidate style={{maxWidth: 270}}>
<Grid container alignItems="stretch" style={{ display: "flex"}}> <Grid container style={{ display: "flex", alignItems: "stretch"}}>
<Grid item style={{ display: "flex" }}> <Grid item style={{ display: "flex", maxWidth:160}} >
<TextField <TextField
error={badInvoice ? true : false} error={badInvoice ? true : false}
helperText={badInvoice ? badInvoice : "" } helperText={badInvoice ? badInvoice : "" }
@ -288,13 +288,14 @@ const ProfileDialog = ({
/> />
</Grid> </Grid>
<Grid item alignItems="stretch" style={{ display: "flex" }}> <Grid item alignItems="stretch" style={{ display: "flex", maxWidth:80}}>
<Button <Button
sx={{maxHeight:38}} sx={{maxHeight:38}}
onClick={() => handleSubmitInvoiceClicked(rewardInvoice)} onClick={(e) => handleSubmitInvoiceClicked(e, rewardInvoice)}
variant="contained" variant="contained"
color="primary" color="primary"
size="small" size="small"
type="submit"
> >
{t("Submit")} {t("Submit")}
</Button> </Button>

View File

@ -3,7 +3,7 @@ export { default as InfoDialog } from "./Info";
export { default as LearnDialog } from "./Learn"; export { default as LearnDialog } from "./Learn";
export { default as NoRobotDialog } from "./NoRobot"; export { default as NoRobotDialog } from "./NoRobot";
export { default as StoreTokenDialog } from "./StoreToken"; export { default as StoreTokenDialog } from "./StoreToken";
export { default as ExchangeSummaryDialog } from "./ExchangeSummaryDialog"; export { default as ExchangeSummaryDialog } from "./ExchangeSummary";
export { default as ProfileDialog } from "./ProfileDialog"; export { default as ProfileDialog } from "./Profile";
export { default as StatsDialog } from "./StatsDialog"; export { default as StatsDialog } from "./Stats";