mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-19 04:31:35 +00:00
Fix empty other payment method after text parse
This commit is contained in:
parent
37844d579d
commit
3a2af01ab6
@ -87,8 +87,6 @@ export default class BookPage extends Component {
|
|||||||
}
|
}
|
||||||
amountToString = (amount,has_range,min_amount,max_amount) => {
|
amountToString = (amount,has_range,min_amount,max_amount) => {
|
||||||
if (has_range){
|
if (has_range){
|
||||||
console.log(this.pn(parseFloat(Number(min_amount).toPrecision(2))))
|
|
||||||
console.log(this.pn(parseFloat(Number(min_amount).toPrecision(2)))+'-'+this.pn(parseFloat(Number(max_amount).toPrecision(2))))
|
|
||||||
return this.pn(parseFloat(Number(min_amount).toPrecision(2)))+'-'+this.pn(parseFloat(Number(max_amount).toPrecision(2)))
|
return this.pn(parseFloat(Number(min_amount).toPrecision(2)))+'-'+this.pn(parseFloat(Number(max_amount).toPrecision(2)))
|
||||||
}else{
|
}else{
|
||||||
return this.pn(parseFloat(Number(amount).toPrecision(3)))
|
return this.pn(parseFloat(Number(amount).toPrecision(3)))
|
||||||
|
@ -65,13 +65,10 @@ export default class PaymentText extends Component {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Adds a Custom icon if there are words that do not match
|
// Adds a Custom icon if there are words that do not match
|
||||||
var words = this.props.text.match(/\b(\w+)\b/g)
|
var chars_left = custom_methods.replace(' ','')
|
||||||
var custom = false
|
chars_left = chars_left.replace(' ','')
|
||||||
words.forEach((word, i) =>{
|
|
||||||
if(!someMethods.map(item => item.name).includes(word)){ custom=true;}
|
if(chars_left.length > 0){rows.push(
|
||||||
});
|
|
||||||
|
|
||||||
if(custom==true){rows.push(
|
|
||||||
<Tooltip placement="top" enterTouchDelay="0" title={this.props.verbose ? "Others": "Other: "+ custom_methods} >
|
<Tooltip placement="top" enterTouchDelay="0" title={this.props.verbose ? "Others": "Other: "+ custom_methods} >
|
||||||
<div style={{position:'relative', display: 'inline-block',width: this.props.size+2, maxHeight: this.props.size, top:'1px'}}>
|
<div style={{position:'relative', display: 'inline-block',width: this.props.size+2, maxHeight: this.props.size, top:'1px'}}>
|
||||||
<PaymentIcon width={this.props.size*1.1} height={this.props.size*1.1} icon={"custom"}/>
|
<PaymentIcon width={this.props.size*1.1} height={this.props.size*1.1} icon={"custom"}/>
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user