2023-02-02 15:02:49 +00:00
|
|
|
use flowy_core::{get_client_server_configuration, AppFlowyCore, AppFlowyCoreConfig};
|
2023-01-17 08:27:17 +00:00
|
|
|
|
2023-02-02 15:02:49 +00:00
|
|
|
pub fn init_flowy_core() -> AppFlowyCore {
|
2023-01-17 08:27:17 +00:00
|
|
|
let data_path = tauri::api::path::data_dir().unwrap();
|
|
|
|
let path = format!("{}/AppFlowy", data_path.to_str().unwrap());
|
|
|
|
let server_config = get_client_server_configuration().unwrap();
|
2023-02-02 15:02:49 +00:00
|
|
|
let config = AppFlowyCoreConfig::new(&path, "AppFlowy".to_string(), server_config)
|
2023-01-17 08:27:17 +00:00
|
|
|
.log_filter("trace", vec!["appflowy_tauri".to_string()]);
|
2023-02-02 15:02:49 +00:00
|
|
|
AppFlowyCore::new(config)
|
2023-01-17 08:27:17 +00:00
|
|
|
}
|