Skip to content

Commit

Permalink
Fix: moonraker widget error when not printing (#2468)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon authored Dec 11, 2023
1 parent bd6f24d commit 25767ba
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/widgets/moonraker/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}>
Expand Down

0 comments on commit 25767ba

Please sign in to comment.