refactor
This commit is contained in:
@@ -881,13 +881,17 @@ impl UI {
|
||||
}
|
||||
pub fn set_config(&mut self, config: VeilidConfigInner) {
|
||||
let mut inner = self.inner.borrow_mut();
|
||||
inner.ui_state.node_id.set(
|
||||
config
|
||||
.network
|
||||
.node_id
|
||||
.map(|x| x.encode())
|
||||
.unwrap_or("<unknown>".to_owned()),
|
||||
);
|
||||
|
||||
let tkv: Vec<TypedKey> = config
|
||||
.network
|
||||
.routing_table
|
||||
.node_ids
|
||||
.iter()
|
||||
.filter_map(|(k, v)| v.node_id.map(|nid| TypedKey::new(*k, nid)))
|
||||
.collect();
|
||||
let tks = TypedKeySet::from(tkv);
|
||||
|
||||
inner.ui_state.node_id.set(tks.to_string());
|
||||
}
|
||||
pub fn set_connection_state(&mut self, state: ConnectionState) {
|
||||
let mut inner = self.inner.borrow_mut();
|
||||
|
||||
Reference in New Issue
Block a user