mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-12 13:33:27 +00:00
Fix panic when opening the same context twice (#14004)
Release Notes: - Fixed a crash that occurred when opening the same context twice in the assistant panel (preview-only).
This commit is contained in:
parent
6cc8412a05
commit
ce7074c883
1 changed files with 3 additions and 2 deletions
|
@ -616,8 +616,9 @@ impl AssistantPanel {
|
||||||
.filter(|editor| editor.read(cx).context.read(cx).path.as_ref() == Some(&path))
|
.filter(|editor| editor.read(cx).context.read(cx).path.as_ref() == Some(&path))
|
||||||
});
|
});
|
||||||
if let Some(existing_context) = existing_context {
|
if let Some(existing_context) = existing_context {
|
||||||
self.show_context(existing_context, cx);
|
return cx.spawn(|this, mut cx| async move {
|
||||||
return Task::ready(Ok(()));
|
this.update(&mut cx, |this, cx| this.show_context(existing_context, cx))
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let saved_context = self.context_store.read(cx).load(path.clone(), cx);
|
let saved_context = self.context_store.read(cx).load(path.clone(), cx);
|
||||||
|
|
Loading…
Reference in a new issue