Skip to content

Commit b9a99a5

Browse files
authored
fix(cli): Skip File Access events in dev server (#12297)
1 parent 98f62e6 commit b9a99a5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.changes/fix-cli-dev-server-reload.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
tauri-cli: 'patch:bug'
3+
'@tauri-apps/cli': 'patch:bug'
4+
---
5+
6+
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.

crates/tauri-cli/src/dev/builtin_dev_server.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,12 @@ fn watch<F: Fn() + Send + 'static>(dir: PathBuf, handler: F) {
170170
.expect("builtin server failed to watch dir");
171171

172172
loop {
173-
if rx.recv().is_ok() {
174-
handler();
173+
if let Ok(Ok(event)) = rx.recv() {
174+
if let Some(event) = event.first() {
175+
if !event.kind.is_access() {
176+
handler();
177+
}
178+
}
175179
}
176180
}
177181
});

0 commit comments

Comments
 (0)