feat: folder web (#4580)

* chore: folder wasm

* chore: folder wasm

* chore: resolve deps

* chore: fix trait

* chore: try localset

* chore: fix

* chore: fix

* chore: fix

* chore: async init sdk

* chore: fix test

* chore: fix test
This commit is contained in:
Nathan.fooo
2024-02-04 05:50:23 +08:00
committed by GitHub
parent 08938b8c70
commit fda70ff560
65 changed files with 818 additions and 558 deletions

View File

@ -60,9 +60,9 @@ dart = [
]
ts = [
"flowy-user/tauri_ts",
"flowy-folder/ts",
"flowy-folder/tauri_ts",
"flowy-database2/ts",
"flowy-config/tauri_ts",
]
rev-sqlite = ["flowy-user/rev-sqlite"]
openssl_vendored = ["flowy-sqlite/openssl_vendored"]
openssl_vendored = ["flowy-sqlite/openssl_vendored"]

View File

@ -24,9 +24,7 @@ use flowy_folder_pub::cloud::{
use flowy_server_pub::af_cloud_config::AFCloudConfiguration;
use flowy_server_pub::supabase_config::SupabaseConfiguration;
use flowy_storage::ObjectValue;
use flowy_user_pub::cloud::{
UserCloudService, UserCloudServiceProvider, UserCloudServiceProviderBase,
};
use flowy_user_pub::cloud::{UserCloudService, UserCloudServiceProvider};
use flowy_user_pub::entities::{Authenticator, UserTokenState};
use lib_infra::future::{to_fut, Fut, FutureResult};
@ -65,9 +63,8 @@ impl ObjectStorageService for ServerProvider {
})
}
}
impl UserCloudServiceProvider for ServerProvider {}
impl UserCloudServiceProviderBase for ServerProvider {
impl UserCloudServiceProvider for ServerProvider {
fn set_token(&self, token: &str) -> Result<(), FlowyError> {
let server = self.get_server()?;
server.set_token(token)?;

View File

@ -10,7 +10,7 @@ use flowy_document::manager::DocumentManager;
use flowy_error::FlowyResult;
use flowy_folder::manager::{FolderInitDataSource, FolderManager};
use flowy_user::event_map::UserStatusCallback;
use flowy_user_pub::cloud::{UserCloudConfig, UserCloudServiceProviderBase};
use flowy_user_pub::cloud::{UserCloudConfig, UserCloudServiceProvider};
use flowy_user_pub::entities::{Authenticator, UserProfile, UserWorkspace};
use lib_infra::future::{to_fut, Fut};

View File

@ -2,9 +2,7 @@
use flowy_storage::ObjectStorageService;
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::RwLock;
use tracing::{debug, error, event, info, instrument};
@ -53,19 +51,10 @@ pub struct AppFlowyCore {
}
impl AppFlowyCore {
#[cfg(target_arch = "wasm32")]
pub async fn new(config: AppFlowyCoreConfig) -> Self {
let runtime = Arc::new(AFPluginRuntime::new().unwrap());
pub async fn new(config: AppFlowyCoreConfig, runtime: Arc<AFPluginRuntime>) -> Self {
Self::init(config, runtime).await
}
#[cfg(not(target_arch = "wasm32"))]
pub fn new(config: AppFlowyCoreConfig) -> Self {
let runtime = Arc::new(AFPluginRuntime::new().unwrap());
let cloned_runtime = runtime.clone();
runtime.block_on(Self::init(config, cloned_runtime))
}
pub fn close_db(&self) {
self.user_manager.close_db();
}