Fix empty other payment method after text parse

This commit is contained in:
Reckless_Satoshi 2022-03-31 02:45:45 -07:00
parent 37844d579d
commit 3a2af01ab6
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
3 changed files with 5 additions and 10 deletions

View File

@ -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)))

View File

@ -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