Fix Android note creation delay: throttle file watcher IPC (#191)

This commit is contained in:
Yuri Karamian
2026-06-30 19:48:19 +02:00
parent 015726f896
commit 13fd70f944
4 changed files with 47 additions and 46 deletions
+9
View File
@@ -61,6 +61,15 @@ pub fn start_watcher(app: AppHandle, vault_path: String) -> Result<RecommendedWa
};
let _ = app.emit("file-changed", &fe);
}
// On mobile, throttle event emission to prevent IPC flooding
// on FUSE filesystems where Syncthing/other apps generate
// constant file activity that blocks the Tauri command channel.
#[cfg(mobile)]
{
std::thread::sleep(Duration::from_secs(2));
while rx.try_recv().is_ok() {}
}
}
Err(e) => {
log::error!("File watcher error: {}", e);