Compare commits
1 Commits
2c2ad7ad21
...
404dca86e1
| Author | SHA1 | Date | |
|---|---|---|---|
|
404dca86e1
|
@@ -23,7 +23,9 @@ fn use_on_document_visibility_change(mut callback: impl FnMut() + 'static) {
|
|||||||
let mut eval = document::eval(
|
let mut eval = document::eval(
|
||||||
r#"
|
r#"
|
||||||
document.addEventListener("visibilitychange", () => {
|
document.addEventListener("visibilitychange", () => {
|
||||||
|
if (!document.hidden) {
|
||||||
dioxus.send(0);
|
dioxus.send(0);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// window.addEventListener("focus", () => resume());
|
// window.addEventListener("focus", () => resume());
|
||||||
|
|||||||
Reference in New Issue
Block a user