Fix UI. Hide unneeded expiry bars. Refresh book always. Round to 8 BTC decimals.

This commit is contained in:
Reckless_Satoshi 2022-07-02 12:51:29 -07:00
parent 64357c9c20
commit a98ff65638
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
5 changed files with 29 additions and 23 deletions

View File

@ -497,19 +497,19 @@ class Order(models.Model):
3: int(config("EXP_TAKER_BOND_INVOICE")), # 'Waiting for taker bond' 3: int(config("EXP_TAKER_BOND_INVOICE")), # 'Waiting for taker bond'
4: 0, # 'Cancelled' 4: 0, # 'Cancelled'
5: 0, # 'Expired' 5: 0, # 'Expired'
6: self.escrow_duration, # 'Waiting for trade collateral and buyer invoice' 6: int(self.escrow_duration), # 'Waiting for trade collateral and buyer invoice'
7: 60 * int(config("INVOICE_AND_ESCROW_DURATION")), # 'Waiting only for seller trade collateral' 7: 60 * int(config("INVOICE_AND_ESCROW_DURATION")), # 'Waiting only for seller trade collateral'
8: 60 * int(config("INVOICE_AND_ESCROW_DURATION")), # 'Waiting only for buyer invoice' 8: 60 * int(config("INVOICE_AND_ESCROW_DURATION")), # 'Waiting only for buyer invoice'
9: 60 * 60 * int(config("FIAT_EXCHANGE_DURATION")), # 'Sending fiat - In chatroom' 9: 60 * 60 * int(config("FIAT_EXCHANGE_DURATION")), # 'Sending fiat - In chatroom'
10: 60 * 60 * int(config("FIAT_EXCHANGE_DURATION")),# 'Fiat sent - In chatroom' 10: 60 * 60 * int(config("FIAT_EXCHANGE_DURATION")),# 'Fiat sent - In chatroom'
11: 1 * 24 * 60 * 60, # 'In dispute' 11: 1 * 24 * 60 * 60, # 'In dispute'
12: 0, # 'Collaboratively cancelled' 12: 0, # 'Collaboratively cancelled'
13: 10 * 24 * 60 * 60, # 'Sending satoshis to buyer' 13: 100 * 24 * 60 * 60, # 'Sending satoshis to buyer'
14: 1 * 24 * 60 * 60, # 'Sucessful trade' 14: 100 * 24 * 60 * 60, # 'Sucessful trade'
15: 10 * 24 * 60 * 60, # 'Failed lightning network routing' 15: 100 * 24 * 60 * 60, # 'Failed lightning network routing'
16: 10 * 24 * 60 * 60, # 'Wait for dispute resolution' 16: 100 * 24 * 60 * 60, # 'Wait for dispute resolution'
17: 1 * 24 * 60 * 60, # 'Maker lost dispute' 17: 100 * 24 * 60 * 60, # 'Maker lost dispute'
18: 1 * 24 * 60 * 60, # 'Taker lost dispute' 18: 100 * 24 * 60 * 60, # 'Taker lost dispute'
} }
return t_to_expire[status] return t_to_expire[status]

View File

@ -892,8 +892,8 @@ class InfoView(ListAPIView):
lifetime_volume = 0 lifetime_volume = 0
context["last_day_nonkyc_btc_premium"] = round(avg_premium, 2) context["last_day_nonkyc_btc_premium"] = round(avg_premium, 2)
context["last_day_volume"] = total_volume context["last_day_volume"] = round(total_volume, 8)
context["lifetime_volume"] = lifetime_volume context["lifetime_volume"] = round(lifetime_volume, 8)
context["lnd_version"] = get_lnd_version() context["lnd_version"] = get_lnd_version()
context["robosats_running_commit_hash"] = get_commit_robosats() context["robosats_running_commit_hash"] = get_commit_robosats()
context["alternative_site"] = config("ALTERNATIVE_SITE") context["alternative_site"] = config("ALTERNATIVE_SITE")

View File

@ -21,10 +21,10 @@ class BookPage extends Component {
this.state = { this.state = {
pageSize: 6, pageSize: 6,
}; };
if(this.props.bookOrders.length == 0){
this.getOrderDetails(2, 0)
} }
componentDidMount() {
this.getOrderDetails(2, 0)
} }
getOrderDetails(type, currency) { getOrderDetails(type, currency) {

View File

@ -605,6 +605,9 @@ class OrderPage extends Component {
</Grid> </Grid>
</ListItem> </ListItem>
{/* if order is in a status that does not expire, do not show countdown */}
{[4,12,13,14,15,16,17,18].includes(this.state.status)? null :
<>
<Divider /> <Divider />
<ListItem> <ListItem>
<ListItemIcon> <ListItemIcon>
@ -615,6 +618,9 @@ class OrderPage extends Component {
</ListItemText> </ListItemText>
</ListItem> </ListItem>
<LinearDeterminate key={this.state.total_secs_exp} totalSecsExp={this.state.total_secs_exp} expiresAt={this.state.expires_at}/> <LinearDeterminate key={this.state.total_secs_exp} totalSecsExp={this.state.total_secs_exp} expiresAt={this.state.expires_at}/>
</>
}
</List> </List>
{/* If the user has a penalty/limit */} {/* If the user has a penalty/limit */}

View File

@ -1159,7 +1159,7 @@ handleRatingRobosatsChange=(e)=>{
return( return(
<Grid container spacing={1}> <Grid container spacing={1}>
{/* Make confirmation sound for Chat Open. */} {/* Make confirmation sound for Chat Open. */}
{this.Sound("chat-open")} {this.Sound("locked-invoice")}
<Grid item xs={12} align="center"> <Grid item xs={12} align="center">
<Typography variant="subtitle1"> <Typography variant="subtitle1">
<b> {this.props.data.is_seller ? t("Chat with the buyer"): t("Chat with the seller")}</b> {" " + this.stepXofY()} <b> {this.props.data.is_seller ? t("Chat with the buyer"): t("Chat with the seller")}</b> {" " + this.stepXofY()}