Skip to content

Commit

Permalink
fix(z-tilt): Fix check for older Klipper versions
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Dec 28, 2024
1 parent 976547e commit e9b56f9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/store/printer/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,9 +780,19 @@ export const getters: GetterTree<PrinterState, RootState> = {
},

existsZtilt: (state) => {
if (!state.gcode) return false
// check for new Klipper gcode.commands for Z_TILT_ADJUST command
const commands = state.gcode?.commands ?? null
if (commands) {
return 'Z_TILT_ADJUST' in commands
}

return 'Z_TILT_ADJUST' in state.gcode.commands
// fallback for older Klipper versions
const settings = state.configfile?.settings ?? null
if (settings) {
return 'z_tilt' in settings
}

return false
},

existsBedTilt: (state) => {
Expand Down

0 comments on commit e9b56f9

Please sign in to comment.