From 33fbe53d48291c6c622e8d3b4bbf4d0210d41025 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 18 Aug 2025 19:16:28 -0400 Subject: [PATCH] client: Make `Client::sign_in_with_optional_connect` a no-op when already connected to Collab (#36449) This PR makes it so `Client::sign_in_with_optional_connect` does nothing when the user is already connected to Collab. This fixes the issue where clicking on a channel link would temporarily disconnect you from Collab. Release Notes: - N/A --- crates/client/src/client.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs index 91bdf001d8..66d5fd89b1 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::(); let mut is_staff_tx = Some(is_staff_tx); cx.update(|cx| {