mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
Restore FiatConversionService network error handling (#3684)
This commit is contained in:
@@ -14,8 +14,9 @@ class FiatConversionService {
|
||||
required CryptoCurrency crypto,
|
||||
required FiatCurrency fiat,
|
||||
required bool torOnly,
|
||||
}) async =>
|
||||
double.parse((await PriceApiClient.getLatestPrice(
|
||||
}) async {
|
||||
try {
|
||||
return double.parse((await PriceApiClient.getLatestPrice(
|
||||
LatestPriceRequest(
|
||||
from: _overrideCryptoCurrency(crypto),
|
||||
to: fiat,
|
||||
@@ -25,4 +26,8 @@ class FiatConversionService {
|
||||
?.quote
|
||||
.toString() ??
|
||||
"0");
|
||||
} catch (e) {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user