pathview: dont clear path when modal is cancelled

This commit is contained in:
Alex Janka 2023-11-27 11:46:13 +11:00
parent 451c4f0fde
commit bf7c7b9169

View file

@ -181,7 +181,9 @@ impl PathView {
file_select_panel.set_can_choose_files(true);
file_select_panel.set_allows_multiple_selection(false);
file_select_panel.show(move |v| {
handler(v.first().map(|v| v.pathbuf()));
if let Some(path) = v.first() {
handler(Some(path.pathbuf()));
}
});
});