mirror of
https://github.com/RoboSats/robosats.git
synced 2025-02-21 12:49:02 +00:00
Fix bugs
This commit is contained in:
parent
5dcb249bb3
commit
48862a7677
@ -108,7 +108,6 @@ export default class OrderPage extends Component {
|
|||||||
escrowInvoice: data.escrow_invoice,
|
escrowInvoice: data.escrow_invoice,
|
||||||
escrowSatoshis: data.escrow_satoshis,
|
escrowSatoshis: data.escrow_satoshis,
|
||||||
invoiceAmount: data.invoice_amount,
|
invoiceAmount: data.invoice_amount,
|
||||||
badRequest: data.bad_request,
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -133,12 +132,6 @@ export default class OrderPage extends Component {
|
|||||||
this.setState({ delay: Number(e.target.value) });
|
this.setState({ delay: Number(e.target.value) });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets currency code (3 letters) from numeric (e.g., 1 -> USD)
|
|
||||||
// Improve this function so currencies are read from json
|
|
||||||
getCurrencyCode(val){
|
|
||||||
return (val == 1 ) ? "USD": ((val == 2 ) ? "EUR":"ETH")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fix to use proper react props
|
// Fix to use proper react props
|
||||||
handleClickBackButton=()=>{
|
handleClickBackButton=()=>{
|
||||||
window.history.back();
|
window.history.back();
|
||||||
@ -169,9 +162,8 @@ export default class OrderPage extends Component {
|
|||||||
// Gets currency code (3 letters) from numeric (e.g., 1 -> USD)
|
// Gets currency code (3 letters) from numeric (e.g., 1 -> USD)
|
||||||
// Improve this function so currencies are read from json
|
// Improve this function so currencies are read from json
|
||||||
getCurrencyCode(val){
|
getCurrencyCode(val){
|
||||||
console.log("---------------------------------")
|
let code = val ? this.state.currencies_dict[val.toString()] : ""
|
||||||
console.log(val)
|
return code
|
||||||
return this.state.currencies_dict[val.toString()]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleClickCancelOrderButton=()=>{
|
handleClickCancelOrderButton=()=>{
|
||||||
|
@ -105,7 +105,7 @@ export default class TradeBox extends Component {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Divider/>
|
<Divider/>
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Typography component="body2" variant="body">
|
<Typography component="body2" variant="body2">
|
||||||
Please wait for the taker to confirm his commitment by locking a bond.
|
Please wait for the taker to confirm his commitment by locking a bond.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -162,8 +162,9 @@ export default class TradeBox extends Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fix this, clunky because it takes time. this.props.data does not refresh until next refresh of OrderPage.
|
||||||
|
|
||||||
handleClickSubmitInvoiceButton=()=>{
|
handleClickSubmitInvoiceButton=()=>{
|
||||||
console.log(this.state)
|
|
||||||
const requestOptions = {
|
const requestOptions = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {'Content-Type':'application/json', 'X-CSRFToken': getCookie('csrftoken'),},
|
headers: {'Content-Type':'application/json', 'X-CSRFToken': getCookie('csrftoken'),},
|
||||||
@ -215,14 +216,72 @@ export default class TradeBox extends Component {
|
|||||||
|
|
||||||
showWaitingForEscrow(){
|
showWaitingForEscrow(){
|
||||||
|
|
||||||
|
return(
|
||||||
|
<Grid container spacing={1}>
|
||||||
|
<Grid item xs={12} align="center">
|
||||||
|
<Typography component="subtitle1" variant="subtitle1">
|
||||||
|
<b>Your invoice looks good!</b>
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} align="center">
|
||||||
|
<Typography component="body2" variant="body2" align="left">
|
||||||
|
<p>We are waiting for the seller to deposit the full trade BTC amount
|
||||||
|
into the escrow.</p>
|
||||||
|
<p> Just hang on for a moment. If the seller does not deposit,
|
||||||
|
you will get your bond back automatically.</p>
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
// showWaitingForBuyerInvoice({
|
|
||||||
|
|
||||||
// })
|
showWaitingForBuyerInvoice(){
|
||||||
|
|
||||||
// showFiatSentButton(){
|
return(
|
||||||
|
<Grid container spacing={1}>
|
||||||
|
<Grid item xs={12} align="center">
|
||||||
|
<Typography component="subtitle1" variant="subtitle1">
|
||||||
|
<b>The trade collateral is locked! :D </b>
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} align="center">
|
||||||
|
<Typography component="body2" variant="body2" align="left">
|
||||||
|
<p> We are waiting for the buyer to post a lightning invoice. Once
|
||||||
|
he does, you will be able to directly communicate the fiat payment
|
||||||
|
details. </p>
|
||||||
|
<p> Just hang on for a moment. If the buyer does not cooperate,
|
||||||
|
you will get back the trade collateral and your bond automatically.</p>
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
handleClickFiatConfirmButton=()=>{
|
||||||
|
const requestOptions = {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {'Content-Type':'application/json', 'X-CSRFToken': getCookie('csrftoken'),},
|
||||||
|
body: JSON.stringify({
|
||||||
|
'action':'confirm',
|
||||||
|
'invoice': this.state.invoice,
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
fetch('/api/order/' + '?order_id=' + this.props.data.id, requestOptions)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => (this.props.data = data));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
showFiatSentButton(){
|
||||||
|
return(
|
||||||
|
<Grid container spacing={1}>
|
||||||
|
<Grid item xs={12} align="center">
|
||||||
|
<Button variant='contained' color='primary' onClick={this.handleClickFiatConfirmButton}>Confirm {this.props.data.currencyCode} was sent. </Button>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// }
|
|
||||||
// showFiatReceivedButton(){
|
// showFiatReceivedButton(){
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
Loading…
Reference in New Issue
Block a user