Browse Source

AGP-215, Read invoice payload

all-modes^2^2
Miika Turunen 7 years ago
parent
commit
29942b1f54
  1. 2
      react/src/components/dashboard/qrModal/qrModal.js
  2. 27
      react/src/components/dashboard/sendCoin/sendCoin.js
  3. 26
      react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js

2
react/src/components/dashboard/qrModal/qrModal.js

@ -68,6 +68,8 @@ class QRModal extends React.Component {
modalIsOpen: false,
errorShown: this.state.error ? true : false,
});
ReactDOM.unmountComponentAtNode(document.getElementById('webcam'));
}
render() {

27
react/src/components/dashboard/sendCoin/sendCoin.js

@ -67,10 +67,29 @@ class SendCoin extends React.Component {
}
setRecieverFromScan(receiver) {
this.setState({
sendTo: receiver
});
try {
var o = JSON.parse(receiver);
if (o && typeof o === "object") {
if(o.coin === this.props.ActiveCoin.coin) {
if(o.amount) {
this.setState({
amount: o.amount
});
}
if(o.address) {
this.setState({
sendTo: o.address
});
}
}
}
}
catch (e) {
this.setState({
sendTo: receiver
});
}
document.getElementById('edexcoinSendTo').focus();
}

26
react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js

@ -81,10 +81,28 @@ class WalletsNativeSend extends React.Component {
}
setRecieverFromScan(receiver) {
this.setState({
sendTo: receiver,
});
try {
var o = JSON.parse(receiver);
if (o && typeof o === "object") {
if(o.coin === this.props.ActiveCoin.coin) {
if(o.amount) {
this.setState({
amount: o.amount
});
}
if(o.address) {
this.setState({
sendTo: o.address
});
}
}
}
}
catch (e) {
this.setState({
sendTo: receiver
});
}
document.getElementById('kmdWalletSendTo').focus();
}

Loading…
Cancel
Save