Skip to content

Commit

Permalink
fix: fix z_tilt button for z_tilt_ng with Kalico (#2078)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Dec 23, 2024
1 parent 4c86d7c commit fc18911
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/components/mixins/control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,16 @@ export default class ControlMixin extends Vue {
}

get colorZTilt() {
const status = this.$store.state.printer.z_tilt?.applied ?? true
let status = true

// normal Klipper z_tilt
if ('z_tilt' in this.$store.state.printer) {
status = this.$store.state.printer.z_tilt?.applied
}
// check Kalico next gen z_tilt
else if ('z_tilt_ng' in this.$store.state.printer) {
status = this.$store.state.printer.z_tilt_ng?.applied
}

return status ? 'primary' : 'warning'
}
Expand Down
4 changes: 2 additions & 2 deletions src/store/printer/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,9 +780,9 @@ export const getters: GetterTree<PrinterState, RootState> = {
},

existsZtilt: (state) => {
if (!state.configfile?.settings) return false
if (!state.gcode) return false

return 'z_tilt' in state.configfile.settings
return 'Z_TILT_ADJUST' in state.gcode.commands
},

existsBedTilt: (state) => {
Expand Down

0 comments on commit fc18911

Please sign in to comment.