mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 12:09:43 +00:00
16 lines
No EOL
585 B
Dart
16 lines
No EOL
585 B
Dart
import 'package:cake_wallet/entities/balance.dart';
|
|
import 'package:mobx/mobx.dart';
|
|
import 'package:cake_wallet/core/wallet_base.dart';
|
|
import 'package:cake_wallet/entities/sync_status.dart';
|
|
|
|
ReactionDisposer _onWalletSyncStatusChangeReaction;
|
|
|
|
void startWalletSyncStatusChangeReaction(WalletBase<Balance> wallet) {
|
|
_onWalletSyncStatusChangeReaction?.reaction?.dispose();
|
|
_onWalletSyncStatusChangeReaction =
|
|
reaction((_) => wallet.syncStatus, (SyncStatus status) async {
|
|
if (status is ConnectedSyncStatus) {
|
|
await wallet.startSync();
|
|
}
|
|
});
|
|
} |