fix(cli): Skip File Access events in dev server (#12297)

This commit is contained in:
Fabian-Lars
2025-01-07 21:11:24 +01:00
committed by GitHub
parent 98f62e65a2
commit b9a99a5c69
2 changed files with 12 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
---
tauri-cli: 'patch:bug'
'@tauri-apps/cli': 'patch:bug'
---
Fixed an issue that caused the built-in dev server to constantly refresh on Linux. This only affected users who do not have `devUrl` point to a URL.

View File

@@ -170,8 +170,12 @@ fn watch<F: Fn() + Send + 'static>(dir: PathBuf, handler: F) {
.expect("builtin server failed to watch dir");
loop {
if rx.recv().is_ok() {
handler();
if let Ok(Ok(event)) = rx.recv() {
if let Some(event) = event.first() {
if !event.kind.is_access() {
handler();
}
}
}
}
});