swap from within wallet fix if started in incognito mode

This commit is contained in:
julian 2023-03-30 12:57:46 -06:00
parent f0d414bc86
commit 7e6f0f18cd

View file

@ -270,11 +270,26 @@ class _WalletViewState extends ConsumerState<WalletView> {
), ),
); );
} else { } else {
final currency = await showLoading( Future<Currency?> _future;
whileFuture: ExchangeDataLoadingService.instance.isar.currencies try {
_future = ExchangeDataLoadingService.instance.isar.currencies
.where() .where()
.tickerEqualToAnyExchangeNameName(coin.ticker) .tickerEqualToAnyExchangeNameName(coin.ticker)
.findFirst(), .findFirst();
} catch (_) {
_future = ExchangeDataLoadingService.instance
.init()
.then(
(_) => ExchangeDataLoadingService.instance.loadAll(),
)
.then((_) => ExchangeDataLoadingService.instance.isar.currencies
.where()
.tickerEqualToAnyExchangeNameName(coin.ticker)
.findFirst());
}
final currency = await showLoading(
whileFuture: _future,
context: context, context: context,
message: "Loading...", message: "Loading...",
); );