mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
fix node editing
This commit is contained in:
parent
045852ec4d
commit
1ff4b9bf88
2 changed files with 12 additions and 8 deletions
|
@ -22,8 +22,8 @@ class NodeForm extends StatelessWidget {
|
|||
nodeViewModel
|
||||
..setAddress((editingNode!.uri.host.toString()))
|
||||
..setPort((editingNode!.uri.port.toString()))
|
||||
..setPassword((editingNode!.password.toString()))
|
||||
..setLogin((editingNode!.login.toString()))
|
||||
..setPassword((editingNode?.password ?? ''))
|
||||
..setLogin((editingNode?.login ?? ''))
|
||||
..setSSL((editingNode!.isSSL))
|
||||
..setTrusted((editingNode!.trusted));
|
||||
}
|
||||
|
|
|
@ -98,16 +98,20 @@ abstract class NodeCreateOrEditViewModelBase with Store {
|
|||
|
||||
@action
|
||||
Future<void> save({Node? editingNode, bool saveAsCurrent = false}) async {
|
||||
final node = Node(
|
||||
uri: uri,
|
||||
type: _walletType,
|
||||
login: login,
|
||||
password: password,
|
||||
useSSL: useSSL,
|
||||
trusted: trusted);
|
||||
try {
|
||||
state = IsExecutingState();
|
||||
if (editingNode != null) {
|
||||
await _nodeSource.delete(editingNode.key);
|
||||
await _nodeSource.put(editingNode.key, node);
|
||||
} else {
|
||||
await _nodeSource.add(node);
|
||||
}
|
||||
final node =
|
||||
Node(uri: uri, type: _walletType, login: login, password: password,
|
||||
useSSL: useSSL, trusted: trusted);
|
||||
await _nodeSource.add(node);
|
||||
|
||||
if (saveAsCurrent) {
|
||||
_settingsStore.nodes[_walletType] = node;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue