mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
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:
@ -13,6 +13,7 @@ use flowy_notification::{register_notification_sender, unregister_all_notificati
|
||||
use flowy_server_pub::AuthenticatorType;
|
||||
use lib_dispatch::prelude::ToBytes;
|
||||
use lib_dispatch::prelude::*;
|
||||
use lib_dispatch::runtime::AFPluginRuntime;
|
||||
|
||||
use crate::appflowy_yaml::save_appflowy_cloud_config;
|
||||
use crate::env_serde::AppFlowyDartConfiguration;
|
||||
@ -52,7 +53,9 @@ unsafe impl Sync for MutexAppFlowyCore {}
|
||||
unsafe impl Send for MutexAppFlowyCore {}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn init_sdk(data: *mut c_char) -> i64 {
|
||||
pub extern "C" fn init_sdk(_port: i64, data: *mut c_char) -> i64 {
|
||||
// and sent it the `Rust's` result
|
||||
// no need to convert anything :)
|
||||
let c_str = unsafe { CStr::from_ptr(data) };
|
||||
let serde_str = c_str.to_str().unwrap();
|
||||
let configuration = AppFlowyDartConfiguration::from_str(serde_str);
|
||||
@ -78,7 +81,13 @@ pub extern "C" fn init_sdk(data: *mut c_char) -> i64 {
|
||||
core.close_db();
|
||||
}
|
||||
|
||||
*APPFLOWY_CORE.0.lock() = Some(AppFlowyCore::new(config));
|
||||
let runtime = Arc::new(AFPluginRuntime::new().unwrap());
|
||||
let cloned_runtime = runtime.clone();
|
||||
// let isolate = allo_isolate::Isolate::new(port);
|
||||
*APPFLOWY_CORE.0.lock() = runtime.block_on(async move {
|
||||
Some(AppFlowyCore::new(config, cloned_runtime).await)
|
||||
// isolate.post("".to_string());
|
||||
});
|
||||
0
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user