Fix patp check in send

This commit is contained in:
finned-palmer 2021-06-30 16:58:05 -05:00 committed by ixv
parent ebf16f0f74
commit e645551f51

View File

@ -64,15 +64,12 @@ const Send = ({ stopSending, value, conversion }) => {
}; };
const checkPayee = (e) => { const checkPayee = (e) => {
console.log('checkPayee', { e });
setError(''); setError('');
let payeeReceived = e.target.value; let payeeReceived = e.target.value;
let isPatp = ob.isValidPatp(payeeReceived); let isPatp = ob.isValidPatp(payeeReceived);
let isAddress = validate(payeeReceived); let isAddress = validate(payeeReceived);
console.log({ payeeReceived, isPatp, isAddress });
if (isPatp) { if (isPatp) {
console.log('isPatp', isPatp);
let command = { 'check-payee': payeeReceived }; let command = { 'check-payee': payeeReceived };
api.btcWalletCommand(command); api.btcWalletCommand(command);
setTimeout(() => { setTimeout(() => {
@ -144,16 +141,14 @@ const Send = ({ stopSending, value, conversion }) => {
}, []); }, []);
useEffect(() => { useEffect(() => {
if (!ready && checkingPatp) { if (!ready && !checkingPatp) {
console.log({ ready, checkingPatp, shipWallets, payee });
if (shipWallets.payee === payee.slice(1) && shipWallets.hasWallet) { if (shipWallets.payee === payee.slice(1) && shipWallets.hasWallet) {
console.log('good');
setReady(true); setReady(true);
setCheckingPatp(false); setCheckingPatp(false);
setValidPayee(true); setValidPayee(true);
} }
} }
}, [ready, checkingPatp, shipWallets]); }, [ready, checkingPatp, shipWallets, payee]);
let payeeColor = 'black'; let payeeColor = 'black';
let payeeBg = 'white'; let payeeBg = 'white';