mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-01 18:07:44 +00:00
15 lines
524 B
Dart
15 lines
524 B
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 wallet) {
|
||
|
_onWalletSyncStatusChangeReaction?.reaction?.dispose();
|
||
|
_onWalletSyncStatusChangeReaction =
|
||
|
reaction((_) => wallet.syncStatus, (SyncStatus status) async {
|
||
|
if (status is ConnectedSyncStatus) {
|
||
|
await wallet.startSync();
|
||
|
}
|
||
|
});
|
||
|
}
|