Clear project browser editor even if an operation fails
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
954fabec42
commit
6021ab12c9
1 changed files with 6 additions and 1 deletions
|
@ -334,9 +334,14 @@ impl ProjectPanel {
|
||||||
cx.notify();
|
cx.notify();
|
||||||
|
|
||||||
Some(cx.spawn(|this, mut cx| async move {
|
Some(cx.spawn(|this, mut cx| async move {
|
||||||
let new_entry = edit_task.await?;
|
let new_entry = edit_task.await;
|
||||||
this.update(&mut cx, |this, cx| {
|
this.update(&mut cx, |this, cx| {
|
||||||
this.edit_state.take();
|
this.edit_state.take();
|
||||||
|
cx.notify();
|
||||||
|
});
|
||||||
|
|
||||||
|
let new_entry = new_entry?;
|
||||||
|
this.update(&mut cx, |this, cx| {
|
||||||
if let Some(selection) = &mut this.selection {
|
if let Some(selection) = &mut this.selection {
|
||||||
if selection.entry_id == edited_entry_id {
|
if selection.entry_id == edited_entry_id {
|
||||||
selection.worktree_id = worktree_id;
|
selection.worktree_id = worktree_id;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue