Skip to content

Commit

Permalink
Fix failure to send on Cardano Mainnet when M1 infra is experiencing …
Browse files Browse the repository at this point in the history
…issues.

Users on Twitter have been complaining that when the flint gateway for M1 is not functioning properly it causes them an inability to use the wallet for Cardano mainnet purposes. This obviously shouldn't be the case, so I have added a simple try-catch fix.
  • Loading branch information
Riley-Kilgore authored and rhyslbw committed Jun 23, 2024
1 parent 5190309 commit 5997784
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ui/app/pages/send.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,13 @@ const Send = () => {
};
utxos.current = _utxos;
_utxos = _utxos.map((utxo) => Buffer.from(utxo.to_bytes()).toString('hex'));
const { current_address: milkomedaAddress } = await getMilkomedaData('');
let milkomedaAddress = '';
try {
const { current_address: milkomedaAddressFromReq } = await getMilkomedaData('');
milkomedaAddress = milkomedaAddressFromReq
} catch (e) {
console.log("ERROR: Couldn't get Milkomeda address.")
}
if (!isMounted.current) return;
setIsLoading(false);
setTxInfo({ protocolParameters, utxos: _utxos, balance, milkomedaAddress });
Expand Down Expand Up @@ -950,6 +956,8 @@ const AddressPopup = ({
};
}
} else if (isM1) {
// We allow failure here because we fail to get the user's Milkomeda
// address when they are creating an M1 transaction.
const { isAllowed, ada, current_address, protocolMagic, assets, ttl } =
await getMilkomedaData(value);

Expand Down

0 comments on commit 5997784

Please sign in to comment.