Merge pull request #2446 from zed-industries/fix-copilot-logged-out

Fix copilot stuck in logged out state
This commit is contained in:
Mikayla Maki 2023-05-04 16:52:04 -04:00 committed by GitHub
commit 3631b3a86c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -461,14 +461,12 @@ impl Copilot {
pub fn sign_in(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
if let CopilotServer::Running(server) = &mut self.server {
let task = match &server.sign_in_status {
SignInStatus::Authorized { .. } | SignInStatus::Unauthorized { .. } => {
Task::ready(Ok(())).shared()
}
SignInStatus::Authorized { .. } => Task::ready(Ok(())).shared(),
SignInStatus::SigningIn { task, .. } => {
cx.notify();
task.clone()
}
SignInStatus::SignedOut => {
SignInStatus::SignedOut | SignInStatus::Unauthorized { .. } => {
let lsp = server.lsp.clone();
let task = cx
.spawn(|this, mut cx| async move {