chore: update deps
This commit is contained in:
@@ -108,12 +108,9 @@ impl AutoUpdater {
|
||||
|
||||
cx.spawn_in(window, async move |this, cx| {
|
||||
if let Ok(Some(update)) = checking.await {
|
||||
cx.update(|window, cx| {
|
||||
this.update(cx, |this, cx| {
|
||||
this.set_status(AutoUpdateStatus::checked(update), cx);
|
||||
this.install_update(window, cx);
|
||||
})
|
||||
.ok();
|
||||
this.update_in(cx, |this, window, cx| {
|
||||
this.set_status(AutoUpdateStatus::checked(update), cx);
|
||||
this.install_update(window, cx);
|
||||
})
|
||||
.ok();
|
||||
} else {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -340,9 +340,11 @@ impl Registry {
|
||||
cx.spawn_in(window, async move |this, cx| {
|
||||
match task.await {
|
||||
Ok(rooms) => {
|
||||
this.update(cx, |this, cx| {
|
||||
this.extend_rooms(rooms, cx);
|
||||
this.sort(cx);
|
||||
this.update_in(cx, |_, window, cx| {
|
||||
cx.defer_in(window, |this, _window, cx| {
|
||||
this.extend_rooms(rooms, cx);
|
||||
this.sort(cx);
|
||||
});
|
||||
})
|
||||
.ok();
|
||||
}
|
||||
@@ -450,7 +452,9 @@ impl Registry {
|
||||
|
||||
// Resort all rooms in the registry by their created at (after updated)
|
||||
if is_new_event {
|
||||
self.sort(cx);
|
||||
cx.defer_in(window, |this, _window, cx| {
|
||||
this.sort(cx);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
let room = Room::new(&event)
|
||||
|
||||
Reference in New Issue
Block a user