Compare commits

..

1 Commits

Author SHA1 Message Date
2c2ad7ad21 fix: automatically reconnect after losing a WebSocket connection
Some checks failed
hadolint check / hadolint check (pull_request) Successful in 13s
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 7s
GitLeaks check / GitLeaks check (pull_request) Successful in 13s
markdownlint check / markdownlint check (pull_request) Failing after 54s
Prettier check / Prettier check (pull_request) Failing after 51s
htmlhint check / htmlhint check (pull_request) Successful in 1m3s
checkov check / checkov check (pull_request) Failing after 2m26s
ShellCheck check / ShellCheck check (pull_request) Successful in 1m14s
Stylelint check / Stylelint check (pull_request) Successful in 1m27s
Rust check / Rust check (pull_request) Failing after 11m40s
yamllint check / yamllint check (pull_request) Successful in 13m36s
2026-01-23 11:04:10 +01:00

View File

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