Support very large channel membership lists (#11939)

Fixes the channel membership dialogue for the zed channel by not
downloading all 111k people in one go.

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-05-16 20:02:25 -06:00 committed by GitHub
parent df3bd40c56
commit 57b5bff299
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 270 additions and 261 deletions

View file

@ -1569,11 +1569,28 @@ impl CollabPanel {
*pending_name = Some(channel_name.clone());
self.channel_store
.update(cx, |channel_store, cx| {
channel_store.create_channel(&channel_name, *location, cx)
let create = self.channel_store.update(cx, |channel_store, cx| {
channel_store.create_channel(&channel_name, *location, cx)
});
if location.is_none() {
cx.spawn(|this, mut cx| async move {
let channel_id = create.await?;
this.update(&mut cx, |this, cx| {
this.show_channel_modal(
channel_id,
channel_modal::Mode::InviteMembers,
cx,
)
})
})
.detach();
.detach_and_prompt_err(
"Failed to create channel",
cx,
|_, _| None,
);
} else {
create.detach_and_prompt_err("Failed to create channel", cx, |_, _| None);
}
cx.notify();
}
ChannelEditingState::Rename {
@ -1859,12 +1876,8 @@ impl CollabPanel {
let workspace = self.workspace.clone();
let user_store = self.user_store.clone();
let channel_store = self.channel_store.clone();
let members = self.channel_store.update(cx, |channel_store, cx| {
channel_store.get_channel_member_details(channel_id, cx)
});
cx.spawn(|_, mut cx| async move {
let members = members.await?;
workspace.update(&mut cx, |workspace, cx| {
workspace.toggle_modal(cx, |cx| {
ChannelModal::new(
@ -1872,7 +1885,6 @@ impl CollabPanel {
channel_store.clone(),
channel_id,
mode,
members,
cx,
)
});