mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 19:55:53 +03:00
Fix master key invoice as well.
This commit is contained in:
parent
eb5d026df4
commit
3b35df4620
@ -59,9 +59,11 @@ const Invoice: React.FC<Props> = ({ stopSending, payee, satsAmount }) => {
|
||||
broadcastSuccess,
|
||||
network,
|
||||
denomination,
|
||||
history,
|
||||
} = useSettings();
|
||||
const [masterTicket, setMasterTicket] = useState('');
|
||||
const [ready, setReady] = useState(false);
|
||||
const [historyLength, setHistoryLength] = useState(0);
|
||||
const [localError, setLocalError] = useState(error);
|
||||
const [broadcasting, setBroadcasting] = useState(false);
|
||||
|
||||
@ -78,6 +80,16 @@ const Invoice: React.FC<Props> = ({ stopSending, payee, satsAmount }) => {
|
||||
return api.btcWalletCommand(command);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (historyLength === 0) {
|
||||
setHistoryLength(history.length);
|
||||
}
|
||||
if (broadcasting && history.length > historyLength) {
|
||||
setBroadcasting(false);
|
||||
stopSending();
|
||||
}
|
||||
}, [history]);
|
||||
|
||||
const sendBitcoin = (ticket: string, psbt: string) => {
|
||||
const newPsbt = bitcoin.Psbt.fromBase64(psbt);
|
||||
setBroadcasting(true);
|
||||
|
Loading…
Reference in New Issue
Block a user