mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 20:21: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) => {
|
||||
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)))
|
||||
}else{
|
||||
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
|
||||
var words = this.props.text.match(/\b(\w+)\b/g)
|
||||
var custom = false
|
||||
words.forEach((word, i) =>{
|
||||
if(!someMethods.map(item => item.name).includes(word)){ custom=true;}
|
||||
});
|
||||
|
||||
if(custom==true){rows.push(
|
||||
var chars_left = custom_methods.replace(' ','')
|
||||
chars_left = chars_left.replace(' ','')
|
||||
|
||||
if(chars_left.length > 0){rows.push(
|
||||
<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'}}>
|
||||
<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