Fix @-mentioning threads when their summary isn't ready yet (#36664)

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra 2025-08-21 10:57:28 +02:00 committed by GitHub
parent ed84767c9d
commit fda6eda3c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 14 deletions

View file

@ -629,15 +629,11 @@ impl MessageEditor {
.shared();
self.mention_set.insert_thread(id.clone(), task.clone());
self.mention_set.insert_uri(crease_id, uri);
let editor = self.editor.clone();
cx.spawn_in(window, async move |this, cx| {
if task.await.notify_async_err(cx).is_some() {
this.update(cx, |this, _| {
this.mention_set.insert_uri(crease_id, uri);
})
.ok();
} else {
if task.await.notify_async_err(cx).is_none() {
editor
.update(cx, |editor, cx| {
editor.display_map.update(cx, |display_map, cx| {
@ -648,6 +644,7 @@ impl MessageEditor {
.ok();
this.update(cx, |this, _| {
this.mention_set.thread_summaries.remove(&id);
this.mention_set.uri_by_crease_id.remove(&crease_id);
})
.ok();
}