Skip to content

Commit

Permalink
fix: fix interface settings Control-Tab when printer is not available (
Browse files Browse the repository at this point in the history
…#2071)

* fix: fix interface settings Control-Tab when printer is not available

Signed-off-by: Stefan Dej <[email protected]>

* fix: also fix a kinematic none system

Signed-off-by: Stefan Dej <[email protected]>

* fix: display only select when klippy is ready

Signed-off-by: Stefan Dej <[email protected]>

---------

Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou authored Dec 7, 2024
1 parent 62269ec commit d3e6371
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
4 changes: 1 addition & 3 deletions src/components/mixins/zoffset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export default class ZoffsetMixin extends Vue {
}

get endstop_pin() {
const stepperConfig = this.settings[this.stepper_name] ?? {}

return stepperConfig?.endstop_pin.trim()
return this.settings[this.stepper_name]?.endstop_pin?.trim() ?? null
}

get zOffset(): number {
Expand Down
28 changes: 15 additions & 13 deletions src/components/settings/SettingsControlTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,20 @@
</settings-row>
<v-divider class="my-2" />
</template>
<settings-row
:title="$t('Settings.ControlTab.ZOffsetSaveOption')"
:sub-title="$t('Settings.ControlTab.ZOffsetSaveOptionDescription')">
<v-select
v-model="offsetZSaveOption"
:items="offsetZSaveOptions"
class="mt-0"
hide-details
outlined
dense />
</settings-row>
<v-divider class="my-2" />
<template v-if="klipperReadyForGui && endstop_pin !== null">
<settings-row
:title="$t('Settings.ControlTab.ZOffsetSaveOption')"
:sub-title="$t('Settings.ControlTab.ZOffsetSaveOptionDescription')">
<v-select
v-model="offsetZSaveOption"
:items="offsetZSaveOptions"
class="mt-0"
hide-details
outlined
dense />
</settings-row>
<v-divider class="my-2" />
</template>
<settings-row :title="$t('Settings.ControlTab.ZOffsetIncrements')" :mobile-second-row="true">
<v-combobox
v-model="offsetsZ"
Expand Down Expand Up @@ -580,7 +582,7 @@ export default class SettingsControlTab extends Mixins(BaseMixin, ControlMixin,
}
mounted() {
this.$refs.formControlExtruder.validate()
this.$refs.formControlExtruder?.validate()
}
}
</script>

0 comments on commit d3e6371

Please sign in to comment.