Skip to content

Commit

Permalink
Merge pull request #1024 from fdm-monster/fix/printer-state-flags-issue
Browse files Browse the repository at this point in the history
fix: stoppable and paused getters state nullref
  • Loading branch information
davidzwa authored Feb 14, 2024
2 parents 1bd129b + 67d4b2f commit f3e266c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/store/printer-state.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ export const usePrinterStateStore = defineStore("PrinterState", {
return (printerId: IdType) => {
const printerEvents = this.printerEventsById[printerId];
if (!printerEvents) return false;
const flags = printerEvents?.current?.payload.state.flags;
const flags = printerEvents?.current?.payload?.state?.flags;
return flags?.printing || flags?.paused;
};
},
isPrinterPaused(): (printerId: IdType) => boolean {
return (printerId: IdType) => {
const printerEvents = this.printerEventsById[printerId];
if (!printerEvents) return false;
const flags = printerEvents?.current?.payload.state.flags;
const flags = printerEvents?.current?.payload?.state?.flags;
return flags?.paused;
};
},
Expand Down

0 comments on commit f3e266c

Please sign in to comment.