mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: check workspace id before write to disk (#5197)
* chore: check workspace id before write to disk * chore: update logs * chore: update logs * chore: update ci * chore: bump client api
This commit is contained in:
@ -77,11 +77,19 @@ pub struct AppFlowyCollabBuilder {
|
||||
|
||||
pub struct CollabBuilderConfig {
|
||||
pub sync_enable: bool,
|
||||
/// If auto_initialize is false, the collab object will not be initialized automatically.
|
||||
/// You need to call collab.initialize() manually.
|
||||
///
|
||||
/// Default is true.
|
||||
pub auto_initialize: bool,
|
||||
}
|
||||
|
||||
impl Default for CollabBuilderConfig {
|
||||
fn default() -> Self {
|
||||
Self { sync_enable: true }
|
||||
Self {
|
||||
sync_enable: true,
|
||||
auto_initialize: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,6 +98,11 @@ impl CollabBuilderConfig {
|
||||
self.sync_enable = sync_enable;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn auto_initialize(mut self, auto_initialize: bool) -> Self {
|
||||
self.auto_initialize = auto_initialize;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl AppFlowyCollabBuilder {
|
||||
@ -292,11 +305,13 @@ impl AppFlowyCollabBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
futures::executor::block_on(arc_collab.lock().initialize());
|
||||
if build_config.auto_initialize {
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
futures::executor::block_on(arc_collab.lock().initialize());
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
arc_collab.lock().initialize();
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
arc_collab.lock().initialize();
|
||||
}
|
||||
|
||||
trace!("collab initialized: {}:{}", object_type, object_id);
|
||||
Ok(arc_collab)
|
||||
|
Reference in New Issue
Block a user