mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 02:21:35 +00:00
Make avatar persists when revisiting homepage
This commit is contained in:
parent
9025b2e07d
commit
1feebacbc1
@ -234,7 +234,8 @@ class Logics:
|
||||
if maker_is_seller:
|
||||
cls.settle_bond(order.maker_bond)
|
||||
cls.return_bond(order.taker_bond)
|
||||
try: # If seller is offline the escrow LNpayment does not even exist
|
||||
# If seller is offline the escrow LNpayment does not exist
|
||||
try:
|
||||
cls.cancel_escrow(order)
|
||||
except:
|
||||
pass
|
||||
@ -245,7 +246,8 @@ class Logics:
|
||||
# If maker is buyer, settle the taker's bond order goes back to public
|
||||
else:
|
||||
cls.settle_bond(order.taker_bond)
|
||||
try: # If seller is offline the escrow LNpayment does not even exist
|
||||
# If seller is offline the escrow LNpayment does not even exist
|
||||
try:
|
||||
cls.cancel_escrow(order)
|
||||
except:
|
||||
pass
|
||||
@ -569,7 +571,7 @@ class Logics:
|
||||
When the second user asks for cancel. Order is totally cancelled.
|
||||
Must have a small cost for both parties to prevent node DDOS."""
|
||||
elif order.status in [
|
||||
Order.Status.WFI, Order.Status.CHA, Order.Status.FSE
|
||||
Order.Status.WFI, Order.Status.CHA
|
||||
]:
|
||||
|
||||
# if the maker had asked, and now the taker does: cancel order, return everything
|
||||
|
@ -180,21 +180,21 @@ export default class BottomBar extends Component {
|
||||
<List>
|
||||
<Divider/>
|
||||
|
||||
<ListItemButton component="a" href="https://t.me/robosats">
|
||||
<ListItemButton component="a" target="_blank" href="https://t.me/robosats">
|
||||
<ListItemIcon><SendIcon/></ListItemIcon>
|
||||
<ListItemText primary="Join the RoboSats group"
|
||||
secondary="Telegram (English / Main)"/>
|
||||
</ListItemButton>
|
||||
<Divider/>
|
||||
|
||||
<ListItemButton component="a" href="https://t.me/robosats_es">
|
||||
<ListItemButton component="a" target="_blank" href="https://t.me/robosats_es">
|
||||
<ListItemIcon><SendIcon/></ListItemIcon>
|
||||
<ListItemText primary="Unase al grupo RoboSats"
|
||||
secondary="Telegram (Español)"/>
|
||||
</ListItemButton>
|
||||
<Divider/>
|
||||
|
||||
<ListItemButton component="a" href="https://github.com/Reckless-Satoshi/robosats/issues">
|
||||
<ListItemButton component="a" target="_blank" href="https://github.com/Reckless-Satoshi/robosats/issues">
|
||||
<ListItemIcon><GitHubIcon/></ListItemIcon>
|
||||
<ListItemText primary="Tell us about a new feature or a bug"
|
||||
secondary="Github Issues - The Robotic Satoshis Open Source Project"/>
|
||||
|
@ -28,13 +28,29 @@ export default class UserGenPage extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
token: this.genBase62Token(36),
|
||||
openInfo: false,
|
||||
loadingRobot: true,
|
||||
tokenHasChanged: false,
|
||||
};
|
||||
this.props.setAppState({avatarLoaded: false, nickname: null, token: null});
|
||||
this.getGeneratedUser(this.state.token);
|
||||
|
||||
//this.props.setAppState({avatarLoaded: false, nickname: null, token: null});
|
||||
|
||||
// Checks in parent HomePage if there is already a nick and token
|
||||
// Displays the existing one
|
||||
if (this.props.nickname != null){
|
||||
this.state = {
|
||||
nickname: this.props.nickname,
|
||||
token: this.props.token? this.props.token : null,
|
||||
avatar_url: 'static/assets/avatars/' + this.props.nickname + '.png',
|
||||
loadingRobot: false
|
||||
}
|
||||
}
|
||||
else{
|
||||
var newToken = this.genBase62Token(36)
|
||||
this.state = {
|
||||
token: newToken
|
||||
}
|
||||
this.getGeneratedUser(newToken);
|
||||
}
|
||||
}
|
||||
|
||||
// sort of cryptographically strong function to generate Base62 token client-side
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user