From 5509c8c9fffbdd4457ce8c75fed5a477732a4b4e Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 6 Jul 2023 10:06:43 +0200 Subject: [PATCH] Fix panic when saved conversations directory changes (#2685) Fixes https://linear.app/zed-industries/issue/Z-2542/deleting-assistant-conversations-with-zed-open-can-cause-a-crash We were updating the view's state but missed a `notify`, which caused the `UniformList` responsible for rendering the saved conversations to panic when some files were deleted. Release Notes: - Fixed a crash that could happen when deleting a saved assistant conversation from the filesystem. --- crates/ai/src/assistant.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ai/src/assistant.rs b/crates/ai/src/assistant.rs index 2b4f733c80..4d300230e1 100644 --- a/crates/ai/src/assistant.rs +++ b/crates/ai/src/assistant.rs @@ -147,8 +147,9 @@ impl AssistantPanel { .await .log_err() .unwrap_or_default(); - this.update(&mut cx, |this, _| { - this.saved_conversations = saved_conversations + this.update(&mut cx, |this, cx| { + this.saved_conversations = saved_conversations; + cx.notify(); }) .ok(); }