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 interface settings Control-Tab when printer is not available #2071

Merged
merged 3 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
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
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>
Loading