From 045852ec4d11d4716862c6a0c8deae7fc760adcc Mon Sep 17 00:00:00 2001 From: Serhii <borodenko.sv@gmail.com> Date: Thu, 30 Mar 2023 15:43:34 +0300 Subject: [PATCH] fix fresh install bug --- lib/di.dart | 3 +-- .../node_list/node_create_or_edit_view_model.dart | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/di.dart b/lib/di.dart index 0b8407cf5..63268dcc5 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -560,8 +560,7 @@ Future setup( (WalletType? type, _) => NodeCreateOrEditViewModel( _nodeSource, type ?? getIt.get<AppStore>().wallet!.type, - getIt.get<SettingsStore>(), - getIt.get<NodeListViewModel>() + getIt.get<SettingsStore>() )); getIt.registerFactoryParam<NodeCreateOrEditPage, Node?, bool?>( diff --git a/lib/view_model/node_list/node_create_or_edit_view_model.dart b/lib/view_model/node_list/node_create_or_edit_view_model.dart index d5171a915..f84d9dfd4 100644 --- a/lib/view_model/node_list/node_create_or_edit_view_model.dart +++ b/lib/view_model/node_list/node_create_or_edit_view_model.dart @@ -13,8 +13,7 @@ class NodeCreateOrEditViewModel = NodeCreateOrEditViewModelBase with _$NodeCreateOrEditViewModel; abstract class NodeCreateOrEditViewModelBase with Store { - NodeCreateOrEditViewModelBase(this._nodeSource, this._walletType, this._settingsStore, - this.nodeListViewModel) + NodeCreateOrEditViewModelBase(this._nodeSource, this._walletType, this._settingsStore) : state = InitialExecutionState(), connectionState = InitialExecutionState(), useSSL = false, @@ -68,7 +67,6 @@ abstract class NodeCreateOrEditViewModelBase with Store { final WalletType _walletType; final Box<Node> _nodeSource; final SettingsStore _settingsStore; - final NodeListViewModel nodeListViewModel; @action void reset() { @@ -103,7 +101,7 @@ abstract class NodeCreateOrEditViewModelBase with Store { try { state = IsExecutingState(); if (editingNode != null) { - await nodeListViewModel.delete(editingNode); + await _nodeSource.delete(editingNode.key); } final node = Node(uri: uri, type: _walletType, login: login, password: password,