Fix: moonraker widget error when not printing (#2468)
This commit is contained in:
1 parent
bd6f24d82a
commit
25767ba3c7
1 file changed
+2
-6
@@ -34,12 +34,8 @@ export default function Component({ service }) {
|
||||
);
|
||||
}
|
||||
|
||||
let currentLayer = "-";
|
||||
let totalLayer = "-";
|
||||
if (printStats.result.status.print_stats.info.total_layer !== null) {
|
||||
currentLayer = printStats.result.status.print_stats.info.current_layer;
|
||||
totalLayer = printStats.result.status.print_stats.info.total_layer;
|
||||
}
|
||||
const printStatsInfo = printStats.result.status.print_stats.info ?? {};
|
||||
const { current_layer: currentLayer = "-", total_layer: totalLayer = "-" } = printStatsInfo;
|
||||
|
||||
return (
|
||||
<Container service={service}>
|
||||
|
||||
Reference in new issue
Block a user