remote servers: Always dismiss modal (#19831)

We display the errors in another window anyway and if the connection
takes a while it looks like a bug that the modal stays open.

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
This commit is contained in:
Thorsten Ball 2024-10-28 16:12:37 +01:00 committed by GitHub
parent e0ea9a9ab5
commit 67eb652bf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -738,7 +738,8 @@ impl RemoteServerProjects {
}; };
let project = project.clone(); let project = project.clone();
let server = server.clone(); let server = server.clone();
cx.spawn(|remote_server_projects, mut cx| async move { cx.emit(DismissEvent);
cx.spawn(|_, mut cx| async move {
let result = open_ssh_project( let result = open_ssh_project(
server.into(), server.into(),
project.paths.into_iter().map(PathBuf::from).collect(), project.paths.into_iter().map(PathBuf::from).collect(),
@ -757,10 +758,6 @@ impl RemoteServerProjects {
) )
.await .await
.ok(); .ok();
} else {
remote_server_projects
.update(&mut cx, |_, cx| cx.emit(DismissEvent))
.ok();
} }
}) })
.detach(); .detach();