Compare commits

..

1 Commits

Author SHA1 Message Date
404dca86e1 fix: automatically reconnect after losing a WebSocket connection
Some checks failed
actionlint check / actionlint check (pull_request) Successful in 7s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 3s
conventional commit messages check / conventional commit messages check (pull_request) Successful in 6s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 9s
GitLeaks check / GitLeaks check (pull_request) Successful in 11s
hadolint check / hadolint check (pull_request) Successful in 14s
Prettier check / Prettier check (pull_request) Failing after 35s
markdownlint check / markdownlint check (pull_request) Failing after 40s
htmlhint check / htmlhint check (pull_request) Successful in 44s
checkov check / checkov check (pull_request) Failing after 1m20s
ShellCheck check / ShellCheck check (pull_request) Successful in 23s
Stylelint check / Stylelint check (pull_request) Successful in 24s
yamllint check / yamllint check (pull_request) Successful in 22s
Rust check / Rust check (pull_request) Failing after 57m45s
2026-01-23 15:25:08 +01:00

View File

@@ -22,17 +22,19 @@ fn use_on_document_visibility_change(mut callback: impl FnMut() + 'static) {
spawn(async move { spawn(async move {
let mut eval = document::eval( let mut eval = document::eval(
r#" r#"
document.addEventListener("visibilitychange", () => { document.addEventListener("visibilitychange", () => {
dioxus.send(0); if (!document.hidden) {
}); dioxus.send(0);
}
});
// window.addEventListener("focus", () => resume()); // window.addEventListener("focus", () => resume());
// Keep this eval alive so dioxus.send keeps working. // Keep this eval alive so dioxus.send keeps working.
// while (true) { // while (true) {
// await new Promise(r => setTimeout(r, 3600_000)); // await new Promise(r => setTimeout(r, 3600_000));
// } // }
"#, "#,
); );
loop { loop {
eval.recv::<u8>() eval.recv::<u8>()