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:
parent
ec7d28648a
commit
2462b949bc
2 changed files with 4 additions and 7 deletions
|
@ -258,11 +258,7 @@ impl ThreadHistory {
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(task) = task_result.log_err() {
|
if let Some(task) = task_result.log_err() {
|
||||||
cx.spawn(async move |this, cx| {
|
task.detach_and_log_err(cx);
|
||||||
task.await?;
|
|
||||||
this.update(cx, |this, cx| this.update_all_entries(cx))
|
|
||||||
})
|
|
||||||
.detach_and_log_err(cx);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
cx.notify();
|
cx.notify();
|
||||||
|
|
|
@ -174,8 +174,9 @@ impl ThreadStore {
|
||||||
let database = database_future.await.map_err(|err| anyhow!(err))?;
|
let database = database_future.await.map_err(|err| anyhow!(err))?;
|
||||||
database.delete_thread(id.clone()).await?;
|
database.delete_thread(id.clone()).await?;
|
||||||
|
|
||||||
this.update(cx, |this, _cx| {
|
this.update(cx, |this, cx| {
|
||||||
this.threads.retain(|thread| thread.id != id)
|
this.threads.retain(|thread| thread.id != id);
|
||||||
|
cx.notify();
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue