2020-09-26 22:17:31 +03:00
|
|
|
import 'package:mobx/mobx.dart';
|
2021-12-24 14:37:24 +02:00
|
|
|
import 'package:cw_core/node.dart';
|
2020-09-26 22:17:31 +03:00
|
|
|
import 'package:cake_wallet/store/app_store.dart';
|
|
|
|
|
|
|
|
ReactionDisposer _onCurrentNodeChangeReaction;
|
|
|
|
|
|
|
|
void startOnCurrentNodeChangeReaction(AppStore appStore) {
|
|
|
|
_onCurrentNodeChangeReaction?.reaction?.dispose();
|
2020-12-15 18:29:10 +02:00
|
|
|
appStore.settingsStore.nodes.observe((change) async {
|
2020-09-26 22:17:31 +03:00
|
|
|
try {
|
2020-12-15 18:29:10 +02:00
|
|
|
await appStore.wallet.connectToNode(node: change.newValue);
|
2020-09-26 22:17:31 +03:00
|
|
|
} catch (e) {
|
|
|
|
print(e.toString());
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|