Implement stopper for bad token push into state

This commit is contained in:
Reckless_Satoshi 2022-01-29 12:29:33 -08:00
parent 4eb136c249
commit c21e230c76
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 8 additions and 3 deletions

View File

@ -217,14 +217,14 @@ export default class BottomBar extends Component {
: :
<ListItem> <ListItem>
<ListItemIcon><NumbersIcon/></ListItemIcon> <ListItemIcon><NumbersIcon/></ListItemIcon>
<ListItemText secondary="Your current order"/> <ListItemText primary="No active orders" secondary="Your current order"/>
</ListItem> </ListItem>
} }
<ListItem> <ListItem>
<ListItemIcon> <ListItemIcon>
<PasswordIcon/> <PasswordIcon/>
</ListItemIcon> </ListItemIcon>
<ListItemText secondary="Last generated token."> <ListItemText secondary="Your token.">
{this.props.token ? {this.props.token ?
<TextField <TextField
disabled disabled

View File

@ -59,10 +59,15 @@ export default class UserGenPage extends Component {
showRobosat:true, showRobosat:true,
}) })
& &
// Add nick and token to App state (token only if not a bad request)
(data.bad_request ? this.props.setAppState({
nickname: data.nickname,
})
:
this.props.setAppState({ this.props.setAppState({
nickname: data.nickname, nickname: data.nickname,
token: this.state.token, token: this.state.token,
}); }));
}); });
} }