This commit is contained in:
Matthew Fosse 2023-12-11 11:27:35 -08:00
parent ee1452b2d6
commit 62513bd933

View file

@ -135,10 +135,23 @@ class AnonPayApi {
}) async { }) async {
double fiatRate = 0.0; double fiatRate = 0.0;
if (fiatCurrency != null) { if (fiatCurrency != null) {
late FiatApiMode fiatApiMode;
switch (apiMode) {
case ExchangeApiMode.torOnly:
fiatApiMode = FiatApiMode.torOnly;
break;
case ExchangeApiMode.disabled:
fiatApiMode = FiatApiMode.disabled;
break;
case ExchangeApiMode.enabled:
default:
fiatApiMode = FiatApiMode.enabled;
break;
}
fiatRate = await FiatConversionService.fetchPrice( fiatRate = await FiatConversionService.fetchPrice(
crypto: cryptoCurrency, crypto: cryptoCurrency,
fiat: fiatCurrency, fiat: fiatCurrency,
apiMode: apiMode, apiMode: fiatApiMode,
); );
} }