Make sign_in init conditional

This commit is contained in:
Mikayla Maki 2023-04-20 08:36:29 -07:00
parent f5bbb41cc2
commit ad8162fc9c

View file

@ -23,8 +23,7 @@ struct OpenGithub;
const COPILOT_SIGN_UP_URL: &'static str = "https://github.com/features/copilot";
pub fn init(cx: &mut AppContext) {
let copilot = Copilot::global(cx).unwrap();
if let Some(copilot) = Copilot::global(cx) {
let mut code_verification: Option<ViewHandle<CopilotCodeVerification>> = None;
cx.observe(&copilot, move |copilot, cx| {
let status = copilot.read(cx).status();
@ -68,6 +67,7 @@ pub fn init(cx: &mut AppContext) {
code_verification.connect_clicked = true;
},
);
}
}
fn create_copilot_auth_window(