Fix typo in status panel that make it crash

Add sanity check if extension has no body
This commit is contained in:
Luc
2024-08-15 16:29:49 +08:00
parent 72742a9171
commit 16ce347cd4
11 changed files with 7 additions and 4 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.

Binary file not shown.

View File

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

View File

@@ -175,8 +175,8 @@ const ExtraContentItem = ({
}, [id, loadContent])
useEffect(() => {
console.log("Updating refresh interval for " + id)
if (refreshtime > 0 && (type === "camera" || type === "image") && visibilityState[id] && !isPaused) {
console.log("Updating refresh interval for " + id)
if (!refreshIntervalRef.current){
console.log("Starting refresh interval for " + id+ " with refreshtime " + refreshtime)
refreshIntervalRef.current = setInterval(loadContent, refreshtime)
@@ -207,6 +207,10 @@ const ExtraContentItem = ({
const doc = iframeElement.contentWindow.document
const body = doc.querySelector("body")
if (!body){
console.error("body not found")
return
}
body.classList.add("body-extension")
const css = document.querySelectorAll("style")
css.forEach((csstag) => {

View File

@@ -142,8 +142,7 @@ const StatusControls = () => {
</div>
)}
{status.printState.printing &&
status.printState.progress !=
"NaN"(
status.printState.progress != "NaN" && (
<Fragment>
<div class="extra-control-value">
{status.printState.progress}%