diff --git a/lib/main.dart b/lib/main.dart index 04c48ae49..ad1ef9b7f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -207,6 +207,7 @@ class _MaterialAppWithThemeState extends ConsumerState didLoad = true; await DB.instance.init(); + await _prefs.init(); _notificationsService = ref.read(notificationsProvider); _nodeService = ref.read(nodeServiceChangeNotifierProvider); @@ -223,7 +224,6 @@ class _MaterialAppWithThemeState extends ConsumerState tradesService: _tradesService, prefs: _prefs, ); - await _prefs.init(); ref.read(priceAnd24hChangeNotifierProvider).start(true); await _wallets.load(_prefs); loadingCompleter.complete(); diff --git a/lib/services/price.dart b/lib/services/price.dart index 924c77f74..4f6650b06 100644 --- a/lib/services/price.dart +++ b/lib/services/price.dart @@ -7,9 +7,8 @@ import 'package:http/http.dart'; import 'package:stackwallet/hive/db.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; -import 'package:tuple/tuple.dart'; - import 'package:stackwallet/utilities/prefs.dart'; +import 'package:tuple/tuple.dart'; class PriceAPI { static const refreshInterval = 60; diff --git a/lib/services/price_service.dart b/lib/services/price_service.dart index 8986d25e5..eb2b1eba4 100644 --- a/lib/services/price_service.dart +++ b/lib/services/price_service.dart @@ -19,9 +19,7 @@ class PriceService extends ChangeNotifier { Tuple2 getPrice(Coin coin) => _cachedPrices[coin]!; - PriceService(this.baseTicker) { - start(true); - } + PriceService(this.baseTicker); Future updatePrice() async { final priceMap =