mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-18 02:07:37 +00:00
18 lines
529 B
Dart
18 lines
529 B
Dart
|
import 'package:mobx/mobx.dart';
|
||
|
import 'package:cake_wallet/entities/node.dart';
|
||
|
import 'package:cake_wallet/store/app_store.dart';
|
||
|
|
||
|
ReactionDisposer _onCurrentNodeChangeReaction;
|
||
|
|
||
|
void startOnCurrentNodeChangeReaction(AppStore appStore) {
|
||
|
_onCurrentNodeChangeReaction?.reaction?.dispose();
|
||
|
_onCurrentNodeChangeReaction =
|
||
|
reaction((_) => appStore.settingsStore.currentNode, (Node node) async {
|
||
|
try {
|
||
|
await appStore.wallet.connectToNode(node: node);
|
||
|
} catch (e) {
|
||
|
print(e.toString());
|
||
|
}
|
||
|
});
|
||
|
}
|