Merge pull request #919 from Wasabi375/unmount

Fix move to home location on unmount
This commit is contained in:
Jeremy Soller 2025-04-05 16:02:52 -06:00 committed by GitHub
commit c7aab10e2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2547,7 +2547,7 @@ impl Application for App {
} }
} }
if !still_mounted { if !still_mounted {
unmounted.push(Location::Path(old_path)); unmounted.push(old_path);
} }
} }
} }
@ -2562,7 +2562,12 @@ impl Application for App {
for entity in entities { for entity in entities {
let title_opt = match self.tab_model.data_mut::<Tab>(entity) { let title_opt = match self.tab_model.data_mut::<Tab>(entity) {
Some(tab) => { Some(tab) => {
if unmounted.contains(&tab.location) { if unmounted.iter().any(|unmounted| {
tab.location
.path_opt()
.map(|location| location.starts_with(unmounted))
.unwrap_or(false)
}) {
tab.change_location(&home_location, None); tab.change_location(&home_location, None);
Some(tab.title()) Some(tab.title())
} else { } else {