fix fresh install bug
Serhii committed
Mar 30, 2023 at 15:43 UTC
045852ec4d11d4716862c6a0c8deae7fc760adcc
2 files changed
+3
-6
lib/di.dart
+1
-2
@@ -560,8 +560,7 @@ Future setup(
560
(WalletType? type, _) => NodeCreateOrEditViewModel(
561
_nodeSource,
562
type ?? getIt.get<AppStore>().wallet!.type,
563
- getIt.get<SettingsStore>(),
564
- getIt.get<NodeListViewModel>()
563
+ getIt.get<SettingsStore>()
564
));
565
566
getIt.registerFactoryParam<NodeCreateOrEditPage, Node?, bool?>(
lib/view_model/node_list/node_create_or_edit_view_model.dart
+2
-4
@@ -13,8 +13,7 @@ class NodeCreateOrEditViewModel = NodeCreateOrEditViewModelBase
13
with _$NodeCreateOrEditViewModel;
14
15
abstract class NodeCreateOrEditViewModelBase with Store {
16
- NodeCreateOrEditViewModelBase(this._nodeSource, this._walletType, this._settingsStore,
17
- this.nodeListViewModel)
16
+ NodeCreateOrEditViewModelBase(this._nodeSource, this._walletType, this._settingsStore)
17
: state = InitialExecutionState(),
18
connectionState = InitialExecutionState(),
19
useSSL = false,
@@ -68,7 +67,6 @@ abstract class NodeCreateOrEditViewModelBase with Store {
67
final WalletType _walletType;
68
final Box<Node> _nodeSource;
69
final SettingsStore _settingsStore;
71
- final NodeListViewModel nodeListViewModel;
70
71
@action
72
void reset() {
@@ -103,7 +101,7 @@ abstract class NodeCreateOrEditViewModelBase with Store {
101
try {
102
state = IsExecutingState();
103
if (editingNode != null) {
106
- await nodeListViewModel.delete(editingNode);
104
+ await _nodeSource.delete(editingNode.key);
105
}
106
final node =
107
Node(uri: uri, type: _walletType, login: login, password: password,