mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
[rust]: Reset INIT_WORKSPACE flag for flutter's hot reload
This commit is contained in:
parent
89bb50eb44
commit
fa683e48c0
@ -70,4 +70,4 @@ SPEC CHECKSUMS:
|
||||
|
||||
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
|
||||
|
||||
COCOAPODS: 1.11.2
|
||||
COCOAPODS: 1.10.1
|
||||
|
@ -206,6 +206,7 @@ async fn fetch_from_local(doc_id: &str, persistence: Arc<Persistence>) -> DocRes
|
||||
let data = op.get_data();
|
||||
if !data.ends_with("\n") {
|
||||
log::error!("The op must end with newline");
|
||||
log::debug!("Invalid delta: {}", delta.to_json());
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -39,6 +39,10 @@ impl WorkspaceController {
|
||||
trash_can: Arc<TrashCan>,
|
||||
server: Server,
|
||||
) -> Self {
|
||||
if let Ok(token) = user.token() {
|
||||
INIT_WORKSPACE.write().insert(token, false);
|
||||
}
|
||||
|
||||
let workspace_sql = Arc::new(WorkspaceTableSql {});
|
||||
Self {
|
||||
user,
|
||||
@ -52,11 +56,13 @@ impl WorkspaceController {
|
||||
}
|
||||
|
||||
async fn init(&self, token: &str) -> Result<(), WorkspaceError> {
|
||||
log::debug!("Start initializing workspace");
|
||||
if let Some(is_init) = INIT_WORKSPACE.read().get(token) {
|
||||
if *is_init {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
log::debug!("Finish initializing workspace");
|
||||
INIT_WORKSPACE.write().insert(token.to_owned(), true);
|
||||
let _ = self.server.init();
|
||||
let _ = self.trash_can.init()?;
|
||||
|
Loading…
Reference in New Issue
Block a user