Skip to content

Commit

Permalink
fix(cli): Skip File Access events in dev server
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianLars committed Jan 7, 2025
1 parent 98f62e6 commit c026926
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/fix-cli-dev-server-reload.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 6 additions & 2 deletions crates/tauri-cli/src/dev/builtin_dev_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
}
});
Expand Down

0 comments on commit c026926

Please sign in to comment.