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