Fix autorefresh ignored in extra content

Bump version
Build package
This commit is contained in:
Luc
2024-12-25 20:04:11 +08:00
parent 046b037498
commit 3e0e7d1701
9 changed files with 7 additions and 6 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -17,7 +17,7 @@
*/
import { h } from "preact"
import { webUIbuild } from "../../targets"
export const webUIversion = "3.0.0-2b1"
export const webUIversion = "3.0.0-3b1"
export const Esp3dVersion = () => (
<span>
{webUIversion}.{webUIbuild}

View File

@@ -100,7 +100,7 @@ const ExtraContentItem = ({
}
if (isPaused || !visibilityState[id] || (target=="panel" && !useUiContextFn.panels.isVisible(elementsCache.getRootfromId(id)))) {
// console.log("Not loading content for " + id + " because it is paused or not visible")
//console.log("Not loading content for " + id + " because it is paused or not visible")
return
}
//console.log("Loading content for " + id)
@@ -110,7 +110,8 @@ const ExtraContentItem = ({
setIsLoading(false)
isLoadedState[id] = true
} else {
if (isLoadedState[id]){
if (isLoadedState[id] && !refreshIntervalRef.current){
//console.log("Already loaded")
return
}
setIsLoading(true)
@@ -192,15 +193,15 @@ const ExtraContentItem = ({
useEffect(() => {
if (refreshtime > 0 && (type === "camera" || type === "image") && visibilityState[id] && !isPaused) {
console.log("Updating refresh interval for " + id)
//console.log("Updating refresh interval for " + id)
if (!refreshIntervalRef.current){
console.log("Starting refresh interval for " + id+ " with refreshtime " + refreshtime)
//console.log("Starting refresh interval for " + id+ " with refreshtime " + refreshtime)
refreshIntervalRef.current = setInterval(loadContent, refreshtime)
}
}
return () => {
if (refreshIntervalRef.current) {
console.log("Stopping refresh interval for " + id)
//console.log("Stopping refresh interval for " + id)
clearInterval(refreshIntervalRef.current)
refreshIntervalRef.current = null
}