mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Integrate appflowy editor (#1040)
This commit is contained in:
@ -3,6 +3,7 @@ pub mod helper;
|
||||
|
||||
use crate::helper::*;
|
||||
|
||||
use flowy_document::entities::DocumentVersionPB;
|
||||
use flowy_net::get_client_server_configuration;
|
||||
use flowy_sdk::{FlowySDK, FlowySDKConfig};
|
||||
use flowy_user::entities::UserProfilePB;
|
||||
@ -28,14 +29,16 @@ impl std::ops::Deref for FlowySDKTest {
|
||||
|
||||
impl std::default::Default for FlowySDKTest {
|
||||
fn default() -> Self {
|
||||
Self::new(false)
|
||||
Self::new(DocumentVersionPB::V0)
|
||||
}
|
||||
}
|
||||
|
||||
impl FlowySDKTest {
|
||||
pub fn new(use_new_editor: bool) -> Self {
|
||||
pub fn new(document_version: DocumentVersionPB) -> Self {
|
||||
let server_config = get_client_server_configuration().unwrap();
|
||||
let config = FlowySDKConfig::new(&root_dir(), &nanoid!(6), server_config, use_new_editor).log_filter("info");
|
||||
let config = FlowySDKConfig::new(&root_dir(), &nanoid!(6), server_config)
|
||||
.with_document_version(document_version)
|
||||
.log_filter("info");
|
||||
let sdk = std::thread::spawn(|| FlowySDK::new(config)).join().unwrap();
|
||||
std::mem::forget(sdk.dispatcher());
|
||||
Self { inner: sdk }
|
||||
@ -51,4 +54,8 @@ impl FlowySDKTest {
|
||||
init_user_setting(self.inner.dispatcher()).await;
|
||||
context.user_profile
|
||||
}
|
||||
|
||||
pub fn document_version(&self) -> DocumentVersionPB {
|
||||
self.inner.config.document.version.clone()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user