mirror of
https://github.com/urbit/shrub.git
synced 2024-12-22 02:11:38 +03:00
Fix patp check in send
This commit is contained in:
parent
ebf16f0f74
commit
e645551f51
@ -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';
|
||||||
|
Loading…
Reference in New Issue
Block a user