mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-24 22:57:12 -04:00
fix folder editor not initialize after hot reload
This commit is contained in:
parent
c95fdc4782
commit
75bc7495bd
1 changed files with 6 additions and 0 deletions
|
@ -74,6 +74,12 @@ impl FolderManager {
|
||||||
document_manager: Arc<FlowyDocumentManager>,
|
document_manager: Arc<FlowyDocumentManager>,
|
||||||
web_socket: Arc<dyn RevisionWebSocket>,
|
web_socket: Arc<dyn RevisionWebSocket>,
|
||||||
) -> Self {
|
) -> 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 folder_editor = Arc::new(TokioRwLock::new(None));
|
||||||
let persistence = Arc::new(FolderPersistence::new(database.clone(), folder_editor.clone()));
|
let persistence = Arc::new(FolderPersistence::new(database.clone(), folder_editor.clone()));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue