Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix folder editor not initialize after hot reload

appflowy75bc7495bd2f
diff --git a/frontend/rust-lib/flowy-core/src/controller.rs b/frontend/rust-lib/flowy-core/src/controller.rs
index e4a6b07f79..79f04815a6 100755
--- a/frontend/rust-lib/flowy-core/src/controller.rs
+++ b/frontend/rust-lib/flowy-core/src/controller.rs
@@ -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()));