mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-10 20:54:33 +00:00
init prefs before doing any network calls
This commit is contained in:
parent
e1e9cb7126
commit
cd0fdad1f6
3 changed files with 3 additions and 6 deletions
|
@ -207,6 +207,7 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
|||
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<MaterialAppWithTheme>
|
|||
tradesService: _tradesService,
|
||||
prefs: _prefs,
|
||||
);
|
||||
await _prefs.init();
|
||||
ref.read(priceAnd24hChangeNotifierProvider).start(true);
|
||||
await _wallets.load(_prefs);
|
||||
loadingCompleter.complete();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -19,9 +19,7 @@ class PriceService extends ChangeNotifier {
|
|||
|
||||
Tuple2<Decimal, double> getPrice(Coin coin) => _cachedPrices[coin]!;
|
||||
|
||||
PriceService(this.baseTicker) {
|
||||
start(true);
|
||||
}
|
||||
PriceService(this.baseTicker);
|
||||
|
||||
Future<void> updatePrice() async {
|
||||
final priceMap =
|
||||
|
|
Loading…
Reference in a new issue