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.

collab_panel: Fix favorite channels not surviving startup (#52541)

Danilo Leal1625f98fb063
diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs
index 74e7a7c82b2..4e3e1ec1bfa 100644
--- a/crates/collab_ui/src/collab_panel.rs
+++ b/crates/collab_ui/src/collab_panel.rs
@@ -683,11 +683,13 @@ impl CollabPanel {
let mut request_entries = Vec::new();
- let previous_len = self.favorite_channels.len();
- self.favorite_channels
- .retain(|id| self.channel_store.read(cx).channel_for_id(*id).is_some());
- if self.favorite_channels.len() != previous_len {
- self.serialize(cx);
+ if self.channel_store.read(cx).channel_count() > 0 {
+ let previous_len = self.favorite_channels.len();
+ self.favorite_channels
+ .retain(|id| self.channel_store.read(cx).channel_for_id(*id).is_some());
+ if self.favorite_channels.len() != previous_len {
+ self.serialize(cx);
+ }
}
let channel_store = self.channel_store.read(cx);