allow body on unknown profile
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -68,12 +68,17 @@ pub fn display_name_widget<'a>(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn about_section_widget<'a, 'b>(profile: &'b ProfileRecord<'a>) -> impl egui::Widget + 'b
|
||||
pub fn about_section_widget<'a, 'b>(
|
||||
profile: Option<&'b ProfileRecord<'a>>,
|
||||
) -> impl egui::Widget + 'b
|
||||
where
|
||||
'b: 'a,
|
||||
{
|
||||
move |ui: &mut egui::Ui| {
|
||||
if let Some(about) = profile.record().profile().and_then(|p| p.about()) {
|
||||
if let Some(about) = profile
|
||||
.map(|p| p.record().profile())
|
||||
.and_then(|p| p.and_then(|p| p.about()))
|
||||
{
|
||||
let resp = ui.label(about);
|
||||
ui.add_space(8.0);
|
||||
resp
|
||||
|
||||
@@ -46,7 +46,7 @@ impl<'a, 'cache> ProfilePreview<'a, 'cache> {
|
||||
&get_display_name(Some(self.profile)),
|
||||
false,
|
||||
));
|
||||
ui.add(about_section_widget(self.profile));
|
||||
ui.add(about_section_widget(Some(self.profile)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user