Fix purchase confirmation logic

Closes #4057
This commit is contained in:
Jeffrey Fisher 2020-04-24 15:22:33 -07:00 committed by Sean Yesmunt
parent f6a9d629a5
commit 65f4562937

View file

@ -197,13 +197,17 @@ export function doPlayUri(
return;
}
if (instantPurchaseEnabled || instantPurchaseMax.currency === 'LBC') {
attemptPlay(instantPurchaseMax.amount);
if (instantPurchaseEnabled) {
if (instantPurchaseMax.currency === 'LBC') {
attemptPlay(instantPurchaseMax.amount);
} else {
// Need to convert currency of instant purchase maximum before trying to play
Lbryio.getExchangeRates().then(({ LBC_USD }) => {
attemptPlay(instantPurchaseMax.amount / LBC_USD);
});
}
} else {
// Need to convert currency of instant purchase maximum before trying to play
Lbryio.getExchangeRates().then(({ LBC_USD }) => {
attemptPlay(instantPurchaseMax.amount / LBC_USD);
});
attemptPlay();
}
};
}