chore: reload workspace when fail to load at the first time (#4633)

* chore: reload workspace when fail to load at the first time

* fix: clippy

* chore: update client api

* chore: fix wasm build

* chore: fix test
This commit is contained in:
Nathan.fooo
2024-02-08 23:53:05 +08:00
committed by GitHub
parent 747fe40648
commit 3b51a6e6be
26 changed files with 468 additions and 197 deletions

View File

@ -128,6 +128,7 @@ impl ServerProvider {
config,
*self.user_enable_sync.read(),
self.config.device_id.clone(),
&self.config.app_version,
));
Ok::<Arc<dyn AppFlowyServer>, FlowyError>(server)

View File

@ -7,7 +7,7 @@ use tracing::event;
use collab_integrate::collab_builder::AppFlowyCollabBuilder;
use flowy_database2::DatabaseManager;
use flowy_document::manager::DocumentManager;
use flowy_error::FlowyResult;
use flowy_error::{FlowyError, FlowyResult};
use flowy_folder::manager::{FolderInitDataSource, FolderManager};
use flowy_user::event_map::UserStatusCallback;
use flowy_user_pub::cloud::{UserCloudConfig, UserCloudServiceProvider};
@ -177,8 +177,13 @@ impl UserStatusCallback for UserStatusCallbackImpl {
}
},
},
Err(_) => FolderInitDataSource::LocalDisk {
create_if_not_exist: true,
Err(err) => match server_type {
Server::Local => FolderInitDataSource::LocalDisk {
create_if_not_exist: true,
},
Server::AppFlowyCloud | Server::Supabase => {
return Err(FlowyError::from(err));
},
},
};

View File

@ -185,7 +185,7 @@ impl AppFlowyCore {
let cloned_user_manager = Arc::downgrade(&user_manager);
if let Some(user_manager) = cloned_user_manager.upgrade() {
if let Err(err) = user_manager
.init(user_status_callback, collab_interact_impl)
.init_with_callback(user_status_callback, collab_interact_impl)
.await
{
error!("Init user failed: {}", err)