ssh: Dismiss file picker when new window is opened (#19600)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-10-23 13:57:50 +02:00 committed by GitHub
parent 7f64f0454d
commit 1bded42b2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -215,11 +215,10 @@ impl ProjectPicker {
connection.port, connection.port,
&connection.username, &connection.username,
); );
cx.new_view(|cx| {
let _path_task = cx let _path_task = cx
.spawn({ .spawn({
let workspace = workspace.clone(); let workspace = workspace.clone();
move |_, mut cx| async move { move |this, mut cx| async move {
let Ok(Some(paths)) = rx.await else { let Ok(Some(paths)) = rx.await else {
workspace workspace
.update(&mut cx, |workspace, cx| { .update(&mut cx, |workspace, cx| {
@ -291,17 +290,19 @@ impl ProjectPicker {
}) })
}) })
.log_err(); .log_err();
this.update(&mut cx, |_, cx| {
cx.emit(DismissEvent);
})
.ok();
Some(()) Some(())
} }
}) })
.shared(); .shared();
cx.new_view(|_| Self {
Self {
_path_task, _path_task,
picker, picker,
connection_string, connection_string,
nickname, nickname,
}
}) })
} }
} }