Skip to content

Commit

Permalink
fix: fix save z offset in toolhead panel (#2060)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Dec 1, 2024
1 parent 0758af1 commit 33efe92
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/mixins/zoffset.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 33efe92

Please sign in to comment.