From 9c2c2df9b052c42ac41e7ac4fa9254d724787a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20=C5=9Eanl=C4=B1?= Date: Tue, 26 Sep 2023 12:29:51 +0300 Subject: [PATCH] Added octoprint offline feature --- src/widgets/octoprint/component.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/widgets/octoprint/component.jsx b/src/widgets/octoprint/component.jsx index ce87548e..e410d463 100644 --- a/src/widgets/octoprint/component.jsx +++ b/src/widgets/octoprint/component.jsx @@ -8,6 +8,12 @@ export default function Component({ service }) { const { data: printerStats, error: printerStatsError } = useWidgetAPI(widget, "printer_stats"); const { data: jobStats, error: jobStatsError } = useWidgetAPI(widget, "job_stats"); + if (printerStatsError && jobStats && jobStats.state==="Offline") { + return + + + } + if (printerStatsError) { return ; }