refactor(startup): auto acceptor on item add to

This commit is contained in:
Nova
2022-12-10 10:26:26 -05:00
parent 0cb039c1be
commit aa79cb2147
3 changed files with 28 additions and 17 deletions

View File

@@ -105,6 +105,17 @@ impl Item {
ui.handle_create_item(&item);
}
let _ = node.item.set(item.clone());
if let Some(auto_acceptor) = node.get_client().and_then(|client| {
client
.startup_settings
.as_ref()
.and_then(|settings| settings.acceptors.get(type_info))
.and_then(|acceptor| acceptor.upgrade())
}) {
capture(&item, &auto_acceptor);
}
item
}
fn make_alias_named(