This commit is contained in:
2026-09-01 09:14:33 +07:00
parent 8f272f1fe8
commit a6e50cf3aa
16 changed files with 116 additions and 78 deletions
+9 -4
View File
@@ -121,8 +121,10 @@ impl RelayListPanel {
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
let relays = task.await?;
// Update state
this.update(cx, |this, cx| {
// Update state. `update_in` (rather than `update`) routes through
// a try-borrow: on wasm a poll that lands while the app context
// is borrowed can't panic and kill this task.
this.update_in(cx, |this, _window, cx| {
this.relays.extend(relays);
cx.notify();
})?;
@@ -167,8 +169,11 @@ impl RelayListPanel {
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
cx.background_executor().timer(Duration::from_secs(2)).await;
// Clear the error message after a delay
this.update(cx, |this, cx| {
// Clear the error message after a delay. `update_in` (rather than
// `update`) routes through a try-borrow: on wasm a poll that
// lands while the app context is borrowed can't panic and kill
// this task.
this.update_in(cx, |this, _window, cx| {
this.error = None;
cx.notify();
})?;