agent: Add missing notify in ThreadHistory::delete_thread (#28144)

This would cause the history view not to get refreshed immediately when
a thread was deleted

Release Notes:

- agent: Fixed a bug where the history view wouldn't refresh after
deleting a thread
This commit is contained in:
Agus Zubiaga 2025-04-05 09:48:10 -03:00 committed by GitHub
parent ec7d28648a
commit 2462b949bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 7 deletions

View file

@ -258,11 +258,7 @@ impl ThreadHistory {
};
if let Some(task) = task_result.log_err() {
cx.spawn(async move |this, cx| {
task.await?;
this.update(cx, |this, cx| this.update_all_entries(cx))
})
.detach_and_log_err(cx);
task.detach_and_log_err(cx);
};
cx.notify();

View file

@ -174,8 +174,9 @@ impl ThreadStore {
let database = database_future.await.map_err(|err| anyhow!(err))?;
database.delete_thread(id.clone()).await?;
this.update(cx, |this, _cx| {
this.threads.retain(|thread| thread.id != id)
this.update(cx, |this, cx| {
this.threads.retain(|thread| thread.id != id);
cx.notify();
})
})
}