You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import 'package:mobx/mobx.dart';
|
|
|
|
import 'package:cw_core/transaction_history.dart';
|
|
|
|
import 'package:cw_core/wallet_base.dart';
|
|
|
|
import 'package:cw_core/balance.dart';
|
|
|
|
import 'package:cw_core/transaction_info.dart';
|
|
|
|
import 'package:cw_core/sync_status.dart';
|
|
|
|
|
|
|
|
ReactionDisposer _onWalletSyncStatusChangeReaction;
|
|
|
|
|
|
|
|
void startWalletSyncStatusChangeReaction(
|
|
|
|
WalletBase<Balance, TransactionHistoryBase<TransactionInfo>,
|
|
|
|
TransactionInfo>
|
|
|
|
wallet) {
|
|
|
|
_onWalletSyncStatusChangeReaction?.reaction?.dispose();
|
|
|
|
_onWalletSyncStatusChangeReaction =
|
|
|
|
reaction((_) => wallet.syncStatus, (SyncStatus status) async {
|
|
|
|
if (status is ConnectedSyncStatus) {
|
|
|
|
await wallet.startSync();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|