From 33efe920cee3659ffd84cdac5f63b7a3764f2238 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 1 Dec 2024 16:52:54 +0100 Subject: [PATCH] fix: fix save z offset in toolhead panel (#2060) --- src/components/mixins/zoffset.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/mixins/zoffset.ts b/src/components/mixins/zoffset.ts index 9785f34ca..9ea91a429 100644 --- a/src/components/mixins/zoffset.ts +++ b/src/components/mixins/zoffset.ts @@ -1,6 +1,5 @@ import Vue from 'vue' import Component from 'vue-class-component' -import { CommandHelp } from '@/store/printer/types' @Component export default class ZoffsetMixin extends Vue { @@ -11,8 +10,9 @@ export default class ZoffsetMixin extends Vue { get z_gcode_offset() { return this.homing_origin.length > 1 ? Math.round(this.homing_origin[2] * 1000) / 1000 : 0 } - get helplist() { - return this.$store.state.printer.helplist ?? [] + + get commands() { + return this.$store.state.printer.gcode?.commands ?? {} } get settings() { @@ -44,11 +44,11 @@ export default class ZoffsetMixin extends Vue { } get existZOffsetApplyProbe() { - return this.helplist.findIndex((gcode: CommandHelp) => gcode.commandLow === 'z_offset_apply_probe') !== -1 + return 'Z_OFFSET_APPLY_PROBE' in this.commands } get existZOffsetApplyEndstop() { - return this.helplist.findIndex((gcode: CommandHelp) => gcode.commandLow === 'z_offset_apply_endstop') !== -1 + return 'Z_OFFSET_APPLY_ENDSTOP' in this.commands } get showSaveButton() {