directly navigate to the mounted drive after mounting them with a click on the sidebar

This commit is contained in:
Frederic Laing 2025-11-17 09:06:02 +01:00
parent 26e223c4f0
commit 0fc6596681
No known key found for this signature in database
GPG key ID: C126157F0CDCD306
2 changed files with 34 additions and 1 deletions

View file

@ -3092,6 +3092,16 @@ impl Application for App {
Message::MountResult(mounter_key, item, res) => match res {
Ok(true) => {
log::info!("connected to {item:?}");
// Automatically navigate to the mounted location
if let Some(path) = item.path() {
let location = if item.is_remote() {
Location::Network(item.uri(), item.name(), Some(path))
} else {
Location::Path(path)
};
let message = Message::TabMessage(None, tab::Message::Location(location));
return self.update(message);
}
}
Ok(false) => {
log::info!("cancelled connection to {item:?}");