chore: update deps

This commit is contained in:
2025-09-03 12:12:40 +07:00
parent d8edac0bb9
commit b11b0e0115
8 changed files with 155 additions and 176 deletions

View File

@@ -886,25 +886,21 @@ impl ChatSpace {
cx.spawn_in(window, async move |this, cx| {
match task.await {
Ok(_) => {
cx.update(|window, cx| {
this.update(cx, |this, cx| {
this.remove_auth_request(&challenge, cx);
this.update_in(cx, |this, window, cx| {
this.remove_auth_request(&challenge, cx);
// Save the authenticated relay to automatically authenticate future requests
settings.update(cx, |this, cx| {
this.push_relay(&url, cx);
});
// Save the authenticated relay to automatically authenticate future requests
settings.update(cx, |this, cx| {
this.push_relay(&url, cx);
});
// Clear the current notification
window.clear_notification_by_id(SharedString::from(challenge), cx);
// Clear the current notification
window.clear_notification_by_id(SharedString::from(challenge), cx);
// Push a new notification after current cycle
cx.defer_in(window, move |_, window, cx| {
window
.push_notification(format!("{url} has been authenticated"), cx);
});
})
.ok();
// Push a new notification after current cycle
cx.defer_in(window, move |_, window, cx| {
window.push_notification(format!("{url} has been authenticated"), cx);
});
})
.ok();
}

View File

@@ -460,12 +460,9 @@ impl Chat {
.ok();
}
Err(e) => {
cx.update(|window, cx| {
this.update(cx, |this, cx| {
window.push_notification(e.to_string(), cx);
this.uploading(false, cx);
})
.ok();
this.update_in(cx, |this, window, cx| {
window.push_notification(e.to_string(), cx);
this.uploading(false, cx);
})
.ok();
}

View File

@@ -69,32 +69,29 @@ impl EditProfile {
cx.spawn_in(window, async move |this, cx| {
if let Ok(Some(metadata)) = task.await {
cx.update(|window, cx| {
this.update(cx, |this: &mut EditProfile, cx| {
this.avatar_input.update(cx, |this, cx| {
if let Some(avatar) = metadata.picture.as_ref() {
this.set_value(avatar, window, cx);
}
});
this.bio_input.update(cx, |this, cx| {
if let Some(bio) = metadata.about.as_ref() {
this.set_value(bio, window, cx);
}
});
this.name_input.update(cx, |this, cx| {
if let Some(display_name) = metadata.display_name.as_ref() {
this.set_value(display_name, window, cx);
}
});
this.website_input.update(cx, |this, cx| {
if let Some(website) = metadata.website.as_ref() {
this.set_value(website, window, cx);
}
});
this.profile = Some(metadata);
cx.notify();
})
.ok();
this.update_in(cx, |this: &mut EditProfile, window, cx| {
this.avatar_input.update(cx, |this, cx| {
if let Some(avatar) = metadata.picture.as_ref() {
this.set_value(avatar, window, cx);
}
});
this.bio_input.update(cx, |this, cx| {
if let Some(bio) = metadata.about.as_ref() {
this.set_value(bio, window, cx);
}
});
this.name_input.update(cx, |this, cx| {
if let Some(display_name) = metadata.display_name.as_ref() {
this.set_value(display_name, window, cx);
}
});
this.website_input.update(cx, |this, cx| {
if let Some(website) = metadata.website.as_ref() {
this.set_value(website, window, cx);
}
});
this.profile = Some(metadata);
cx.notify();
})
.ok();
}

View File

@@ -194,14 +194,11 @@ impl NewAccount {
cx.spawn_in(window, async move |this, cx| {
match Flatten::flatten(task.await.map_err(|e| e.into())) {
Ok(Ok(url)) => {
cx.update(|window, cx| {
this.update(cx, |this, cx| {
this.uploading(false, cx);
this.avatar_input.update(cx, |this, cx| {
this.set_value(url.to_string(), window, cx);
});
})
.ok();
this.update_in(cx, |this, window, cx| {
this.uploading(false, cx);
this.avatar_input.update(cx, |this, cx| {
this.set_value(url.to_string(), window, cx);
});
})
.ok();
}

View File

@@ -192,11 +192,8 @@ impl Sidebar {
fn debounced_search(&self, window: &mut Window, cx: &mut Context<Self>) -> Task<()> {
cx.spawn_in(window, async move |this, cx| {
cx.update(|window, cx| {
this.update(cx, |this, cx| {
this.search(window, cx);
})
.ok();
this.update_in(cx, |this, window, cx| {
this.search(window, cx);
})
.ok();
})
@@ -227,18 +224,15 @@ impl Sidebar {
cx.spawn_in(window, async move |this, cx| {
match task.await {
Ok(Some(results)) => {
cx.update(|window, cx| {
this.update(cx, |this, cx| {
let msg = t!("sidebar.empty", query = query_cloned);
let rooms = results.into_iter().map(|r| cx.new(|_| r)).collect_vec();
this.update_in(cx, |this, window, cx| {
let msg = t!("sidebar.empty", query = query_cloned);
let rooms = results.into_iter().map(|r| cx.new(|_| r)).collect_vec();
if rooms.is_empty() {
window.push_notification(msg, cx);
}
if rooms.is_empty() {
window.push_notification(msg, cx);
}
this.results(rooms, true, window, cx);
})
.ok();
this.results(rooms, true, window, cx);
})
.ok();
}
@@ -254,12 +248,10 @@ impl Sidebar {
}
// Async task failed
Err(e) => {
cx.update(|window, cx| {
this.update(cx, |this, cx| {
window.push_notification(e.to_string(), cx);
this.set_finding(false, window, cx);
this.set_cancel_handle(None, cx);
})
this.update_in(cx, |this, window, cx| {
window.push_notification(e.to_string(), cx);
this.set_finding(false, window, cx);
this.set_cancel_handle(None, cx);
})
.ok();
}