fix(frontend): Fix deno logo + add missing onDestroy (#3025)

This commit is contained in:
Faton Ramadani
2024-01-17 16:26:33 +01:00
committed by GitHub
parent ae8f56a930
commit 14099b49ac
2 changed files with 37 additions and 24 deletions
File diff suppressed because one or more lines are too long
@@ -275,6 +275,14 @@
jobs?.filter((x) => x.type == 'CompletedJob').map((x) => x as CompletedJob) ?? []
}
function onVisibilityChange() {
if (document.hidden) {
sync = false
} else {
sync = true
}
}
onMount(() => {
mounted = true
loadPaths()
@@ -283,17 +291,12 @@
intervalId = setInterval(syncer, refreshRate)
document.addEventListener('visibilitychange', () => {
if (document.hidden) {
sync = false
} else {
sync = true
}
})
document.addEventListener('visibilitychange', onVisibilityChange)
window.addEventListener('popstate', updateFiltersFromURL)
return () => {
window.removeEventListener('popstate', updateFiltersFromURL)
window.removeEventListener('visibilitychange', onVisibilityChange)
}
})