connections: check availability after adding

This commit is contained in:
ardocrat
2023-08-09 22:55:12 +03:00
parent 7ef558a6f1
commit e235123516
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -332,7 +332,6 @@ impl ConnectionsContent {
let error = Url::parse(self.ext_node_url_edit.as_str()).is_err();
self.ext_node_url_error = error;
if !error {
// Save external connection.
let url = self.ext_node_url_edit.to_owned();
let secret = if self.ext_node_secret_edit.is_empty() {
None
@@ -340,13 +339,14 @@ impl ConnectionsContent {
Some(self.ext_node_secret_edit.to_owned())
};
// Update or create new connections.
// Update or create new connection.
let mut ext_conn = ExternalConnection::new(url, secret);
ext_conn.check_conn_availability();
if let Some(id) = self.ext_conn_id_edit {
ext_conn.id = id;
}
ConnectionsConfig::add_ext_conn(ext_conn);
self.ext_conn_id_edit = None;
ConnectionsConfig::add_ext_conn(ext_conn);
// Close modal.
cb.hide_keyboard();