Start separating authentication from connection to collab (#35471)
This pull request should be idempotent, but lays the groundwork for avoiding to connect to collab in order to interact with AI features provided by Zed. Release Notes: - N/A --------- Co-authored-by: Marshall Bowers <git@maxdeviant.com> Co-authored-by: Richard Feldman <oss@rtfeldman.com>
This commit is contained in:
parent
b01d1872cc
commit
f888f3fc0b
46 changed files with 653 additions and 855 deletions
|
@ -2331,7 +2331,7 @@ impl CollabPanel {
|
|||
let client = this.client.clone();
|
||||
cx.spawn_in(window, async move |_, cx| {
|
||||
client
|
||||
.authenticate_and_connect(true, &cx)
|
||||
.connect(true, &cx)
|
||||
.await
|
||||
.into_response()
|
||||
.notify_async_err(cx);
|
||||
|
|
|
@ -634,13 +634,13 @@ impl Render for NotificationPanel {
|
|||
.child(Icon::new(IconName::Envelope)),
|
||||
)
|
||||
.map(|this| {
|
||||
if self.client.user_id().is_none() {
|
||||
if !self.client.status().borrow().is_connected() {
|
||||
this.child(
|
||||
v_flex()
|
||||
.gap_2()
|
||||
.p_4()
|
||||
.child(
|
||||
Button::new("sign_in_prompt_button", "Sign in")
|
||||
Button::new("connect_prompt_button", "Connect")
|
||||
.icon_color(Color::Muted)
|
||||
.icon(IconName::Github)
|
||||
.icon_position(IconPosition::Start)
|
||||
|
@ -652,10 +652,7 @@ impl Render for NotificationPanel {
|
|||
let client = client.clone();
|
||||
window
|
||||
.spawn(cx, async move |cx| {
|
||||
match client
|
||||
.authenticate_and_connect(true, &cx)
|
||||
.await
|
||||
{
|
||||
match client.connect(true, &cx).await {
|
||||
util::ConnectionResult::Timeout => {
|
||||
log::error!("Connection timeout");
|
||||
}
|
||||
|
@ -673,7 +670,7 @@ impl Render for NotificationPanel {
|
|||
)
|
||||
.child(
|
||||
div().flex().w_full().items_center().child(
|
||||
Label::new("Sign in to view notifications.")
|
||||
Label::new("Connect to view notifications.")
|
||||
.color(Color::Muted)
|
||||
.size(LabelSize::Small),
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue