fix folder editor not initialize after hot reload

This commit is contained in:
appflowy 2022-01-27 15:34:31 +08:00
parent c95fdc4782
commit 75bc7495bd

View File

@ -74,6 +74,12 @@ impl FolderManager {
document_manager: Arc<FlowyDocumentManager>,
web_socket: Arc<dyn RevisionWebSocket>,
) -> Self {
if let Ok(user_id) = user.user_id() {
// Reset the flag if the folder manager gets initialized, otherwise,
// the folder_editor will not be initialized after flutter hot reload.
INIT_FOLDER_FLAG.write().await.insert(user_id.to_owned(), false);
}
let folder_editor = Arc::new(TokioRwLock::new(None));
let persistence = Arc::new(FolderPersistence::new(database.clone(), folder_editor.clone()));