Attempt to automatically sign in after a window has been shown
This commit is contained in:
parent
19a48a43c7
commit
df69ac42fb
1 changed files with 15 additions and 17 deletions
|
@ -130,22 +130,6 @@ fn main() {
|
||||||
diagnostics::init(cx);
|
diagnostics::init(cx);
|
||||||
search::init(cx);
|
search::init(cx);
|
||||||
vim::init(cx);
|
vim::init(cx);
|
||||||
cx.spawn({
|
|
||||||
let client = client.clone();
|
|
||||||
|cx| async move {
|
|
||||||
if stdout_is_a_pty() {
|
|
||||||
if client::IMPERSONATE_LOGIN.is_some() {
|
|
||||||
client.authenticate_and_connect(false, &cx).await?;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if client.has_keychain_credentials(&cx) {
|
|
||||||
client.authenticate_and_connect(true, &cx).await?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok::<_, anyhow::Error>(())
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.detach_and_log_err(cx);
|
|
||||||
|
|
||||||
let (settings_file, keymap_file) = cx.background().block(config_files).unwrap();
|
let (settings_file, keymap_file) = cx.background().block(config_files).unwrap();
|
||||||
let mut settings_rx = settings_from_files(
|
let mut settings_rx = settings_from_files(
|
||||||
|
@ -184,7 +168,7 @@ fn main() {
|
||||||
languages,
|
languages,
|
||||||
themes,
|
themes,
|
||||||
channel_list,
|
channel_list,
|
||||||
client,
|
client: client.clone(),
|
||||||
user_store,
|
user_store,
|
||||||
fs,
|
fs,
|
||||||
build_window_options,
|
build_window_options,
|
||||||
|
@ -218,6 +202,20 @@ fn main() {
|
||||||
})
|
})
|
||||||
.detach();
|
.detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cx.spawn(|cx| async move {
|
||||||
|
if stdout_is_a_pty() {
|
||||||
|
if client::IMPERSONATE_LOGIN.is_some() {
|
||||||
|
client.authenticate_and_connect(false, &cx).await?;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if client.has_keychain_credentials(&cx) {
|
||||||
|
client.authenticate_and_connect(true, &cx).await?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok::<_, anyhow::Error>(())
|
||||||
|
})
|
||||||
|
.detach_and_log_err(cx);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue