Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Exclude disconnected channel views from following messages

Max Brunsfeld2e5461ee4de8
diff --git a/crates/collab_ui/src/channel_view.rs b/crates/collab_ui/src/channel_view.rs
index b2e65eb2fa1..817e9fcb4ed 100644
--- a/crates/collab_ui/src/channel_view.rs
+++ b/crates/collab_ui/src/channel_view.rs
@@ -285,10 +285,14 @@ impl FollowableItem for ChannelView {
}
fn to_state_proto(&self, cx: &AppContext) -> Option<proto::view::Variant> {
- let channel = self.channel_buffer.read(cx).channel();
+ let channel_buffer = self.channel_buffer.read(cx);
+ if !channel_buffer.is_connected() {
+ return None;
+ }
+
Some(proto::view::Variant::ChannelView(
proto::view::ChannelView {
- channel_id: channel.id,
+ channel_id: channel_buffer.channel().id,
editor: if let Some(proto::view::Variant::Editor(proto)) =
self.editor.read(cx).to_state_proto(cx)
{