From 6021ab12c9b1b950dccc3a9ec1a89df08970cdde Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 5 May 2022 15:43:42 +0200 Subject: [PATCH] Clear project browser editor even if an operation fails Co-Authored-By: Nathan Sobo --- crates/project_panel/src/project_panel.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index 9530b2c2e2284e41101a7ca7287eb371ef9e5bc4..7d459ad99a1ecc2634083c0fe7cead368e50af5b 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -334,9 +334,14 @@ impl ProjectPanel { cx.notify(); 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.edit_state.take(); + cx.notify(); + }); + + let new_entry = new_entry?; + this.update(&mut cx, |this, cx| { if let Some(selection) = &mut this.selection { if selection.entry_id == edited_entry_id { selection.worktree_id = worktree_id;