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.

client: Make `Client::sign_in_with_optional_connect` a no-op when already connected to Collab (#36449)

Marshall Bowers33fbe53d4829
diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs
index 91bdf001d8a..66d5fd89b15 100644
--- a/crates/client/src/client.rs
+++ b/crates/client/src/client.rs
@@ -973,6 +973,11 @@ impl Client {
try_provider: bool,
cx: &AsyncApp,
) -> Result<()> {
+ // Don't try to sign in again if we're already connected to Collab, as it will temporarily disconnect us.
+ if self.status().borrow().is_connected() {
+ return Ok(());
+ }
+
let (is_staff_tx, is_staff_rx) = oneshot::channel::<bool>();
let mut is_staff_tx = Some(is_staff_tx);
cx.update(|cx| {