mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-21 06:18:42 +02:00
TMP 2
This commit is contained in:
@@ -12,6 +12,7 @@ class NodeListStore = NodeListBase with _$NodeListStore;
|
||||
abstract class NodeListBase with Store {
|
||||
NodeListBase({this.nodesSource}) {
|
||||
nodes = ObservableList<Node>();
|
||||
disabledState = true;
|
||||
_onNodesChangeSubscription = nodesSource.watch().listen((e) => update());
|
||||
update();
|
||||
}
|
||||
@@ -25,6 +26,9 @@ abstract class NodeListBase with Store {
|
||||
@observable
|
||||
String errorMessage;
|
||||
|
||||
@observable
|
||||
bool disabledState;
|
||||
|
||||
Box<Node> nodesSource;
|
||||
|
||||
StreamSubscription<BoxEvent> _onNodesChangeSubscription;
|
||||
@@ -61,6 +65,11 @@ abstract class NodeListBase with Store {
|
||||
@action
|
||||
Future reset() async => await resetToDefault(nodesSource);
|
||||
|
||||
@action
|
||||
void setDisabledState(bool isDisable) {
|
||||
disabledState = isDisable;
|
||||
}
|
||||
|
||||
Future<bool> isNodeOnline(Node node) async {
|
||||
try {
|
||||
return await node.requestNode(node.uri,
|
||||
|
||||
Reference in New Issue
Block a user