FIX: Scanning a Vault PSBT Qr code when scanning for a send address hangs the app

This commit is contained in:
Overtorment 2021-01-11 17:45:19 +00:00
parent 73d6026167
commit c68131dbd7

View file

@ -282,6 +282,13 @@ export default class SendDetails extends Component {
processAddressData = data => {
this.setState({ isLoading: true }, async () => {
const recipients = this.state.addresses;
if (!data.replace) {
// user probably scanned PSBT and got an object instead of string..?
this.setState({
isLoading: false,
});
return alert(loc.send.details_address_field_is_not_valid);
}
const dataWithoutSchema = data.replace('bitcoin:', '').replace('BITCOIN:', '');
if (this.state.fromWallet.isAddressValid(dataWithoutSchema)) {
recipients[[this.state.recipientsScrollIndex]].address = dataWithoutSchema;