From 62513bd933ec242aaafa6b9a56af4ce496f279a0 Mon Sep 17 00:00:00 2001 From: Matthew Fosse Date: Mon, 11 Dec 2023 11:27:35 -0800 Subject: [PATCH] fix --- lib/anonpay/anonpay_api.dart | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/anonpay/anonpay_api.dart b/lib/anonpay/anonpay_api.dart index c39447c03..e0729fec9 100644 --- a/lib/anonpay/anonpay_api.dart +++ b/lib/anonpay/anonpay_api.dart @@ -135,10 +135,23 @@ class AnonPayApi { }) async { double fiatRate = 0.0; 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( crypto: cryptoCurrency, fiat: fiatCurrency, - apiMode: apiMode, + apiMode: fiatApiMode, ); }