bandaid fix

This commit is contained in:
julian 2023-12-10 12:58:50 -06:00
parent 1fb62d3e54
commit 0ce0b1d30e
2 changed files with 11 additions and 0 deletions

View file

@ -107,6 +107,7 @@ class _ExchangeCurrencySelectionViewState
if (widget.pairedTicker == null) {
return await _getCurrencies();
}
await ExchangeDataLoadingService.instance.initDB();
List<Currency> currencies = await ExchangeDataLoadingService
.instance.isar.currencies
.where()
@ -153,6 +154,7 @@ class _ExchangeCurrencySelectionViewState
}
Future<List<Currency>> _getCurrencies() async {
await ExchangeDataLoadingService.instance.initDB();
final currencies = await ExchangeDataLoadingService.instance.isar.currencies
.where()
.filter()

View file

@ -196,6 +196,9 @@ class ExchangeDataLoadingService {
}
Future<void> _loadChangeNowCurrencies() async {
if (_isar == null) {
await initDB();
}
final exchange = ChangeNowExchange.instance;
final responseCurrencies = await exchange.getAllCurrencies(false);
if (responseCurrencies.value != null) {
@ -325,6 +328,9 @@ class ExchangeDataLoadingService {
// }
Future<void> loadMajesticBankCurrencies() async {
if (_isar == null) {
await initDB();
}
final exchange = MajesticBankExchange.instance;
final responseCurrencies = await exchange.getAllCurrencies(false);
@ -347,6 +353,9 @@ class ExchangeDataLoadingService {
}
Future<void> loadTrocadorCurrencies() async {
if (_isar == null) {
await initDB();
}
final exchange = TrocadorExchange.instance;
final responseCurrencies = await exchange.getAllCurrencies(false);