Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix save z offset in toolhead panel #2060

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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