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.

chore: using write lock to fix acquire lock error (#5938)

Nathan.fooo1db8480b7550
diff --git a/frontend/rust-lib/flowy-folder/src/manager.rs b/frontend/rust-lib/flowy-folder/src/manager.rs
index c5cfb2b85c..0f3ff02c1e 100644
--- a/frontend/rust-lib/flowy-folder/src/manager.rs
+++ b/frontend/rust-lib/flowy-folder/src/manager.rs
@@ -373,7 +373,7 @@ impl FolderManager {
F1: FnOnce() -> Output,
F2: FnOnce(&Folder) -> Output,
{
- let folder = self.mutex_folder.read();
+ let folder = self.mutex_folder.write();
match &*folder {
None => none_callback(),
Some(folder) => f2(folder),