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
|
@ -15,7 +15,6 @@ mod toast_layer;
|
|||
mod toolbar;
|
||||
mod workspace_settings;
|
||||
|
||||
use client::CloudUserStore;
|
||||
pub use toast_layer::{ToastAction, ToastLayer, ToastView};
|
||||
|
||||
use anyhow::{Context as _, Result, anyhow};
|
||||
|
@ -840,7 +839,6 @@ pub struct AppState {
|
|||
pub languages: Arc<LanguageRegistry>,
|
||||
pub client: Arc<Client>,
|
||||
pub user_store: Entity<UserStore>,
|
||||
pub cloud_user_store: Entity<CloudUserStore>,
|
||||
pub workspace_store: Entity<WorkspaceStore>,
|
||||
pub fs: Arc<dyn fs::Fs>,
|
||||
pub build_window_options: fn(Option<Uuid>, &mut App) -> WindowOptions,
|
||||
|
@ -913,8 +911,6 @@ impl AppState {
|
|||
let client = Client::new(clock, http_client.clone(), cx);
|
||||
let session = cx.new(|cx| AppSession::new(Session::test(), cx));
|
||||
let user_store = cx.new(|cx| UserStore::new(client.clone(), cx));
|
||||
let cloud_user_store =
|
||||
cx.new(|cx| CloudUserStore::new(client.cloud_client(), user_store.clone(), cx));
|
||||
let workspace_store = cx.new(|cx| WorkspaceStore::new(client.clone(), cx));
|
||||
|
||||
theme::init(theme::LoadThemes::JustBase, cx);
|
||||
|
@ -926,7 +922,6 @@ impl AppState {
|
|||
fs,
|
||||
languages,
|
||||
user_store,
|
||||
cloud_user_store,
|
||||
workspace_store,
|
||||
node_runtime: NodeRuntime::unavailable(),
|
||||
build_window_options: |_, _| Default::default(),
|
||||
|
@ -5739,16 +5734,12 @@ impl Workspace {
|
|||
|
||||
let client = project.read(cx).client();
|
||||
let user_store = project.read(cx).user_store();
|
||||
let cloud_user_store =
|
||||
cx.new(|cx| CloudUserStore::new(client.cloud_client(), user_store.clone(), cx));
|
||||
|
||||
let workspace_store = cx.new(|cx| WorkspaceStore::new(client.clone(), cx));
|
||||
let session = cx.new(|cx| AppSession::new(Session::test(), cx));
|
||||
window.activate_window();
|
||||
let app_state = Arc::new(AppState {
|
||||
languages: project.read(cx).languages().clone(),
|
||||
workspace_store,
|
||||
cloud_user_store,
|
||||
client,
|
||||
user_store,
|
||||
fs: project.read(cx).fs().clone(),
|
||||
|
@ -6947,10 +6938,13 @@ async fn join_channel_internal(
|
|||
match status {
|
||||
Status::Connecting
|
||||
| Status::Authenticating
|
||||
| Status::Authenticated
|
||||
| Status::Reconnecting
|
||||
| Status::Reauthenticating => continue,
|
||||
Status::Connected { .. } => break 'outer,
|
||||
Status::SignedOut => return Err(ErrorCode::SignedOut.into()),
|
||||
Status::SignedOut | Status::AuthenticationError => {
|
||||
return Err(ErrorCode::SignedOut.into());
|
||||
}
|
||||
Status::UpgradeRequired => return Err(ErrorCode::UpgradeRequired.into()),
|
||||
Status::ConnectionError | Status::ConnectionLost | Status::ReconnectionError { .. } => {
|
||||
return Err(ErrorCode::Disconnected.into());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue