Skip to content

Commit

Permalink
fix(control): check set actionButton before display it
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Jul 20, 2024
1 parent 477c958 commit e10f438
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/components/panels/ToolheadControls/CircleControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,16 @@ export default class CircleControl extends Mixins(BaseMixin, ControlMixin) {
'M3.78 2.5L21.5 20.22l-1.27 1.28L18 19.27V20h-8l-2-2H5v-3H3v3H1v-8h2v3h2v-3l1.87-1.86L2.5 3.77L3.78 2.5M20 9v3h-2V8h-6V6h3V4H7.82l15 15H23V9h-3Z'
get actionButton(): string {
return this.$store.state.gui.control.actionButton ?? this.defaultActionButton
const button = this.$store.state.gui.control.actionButton ?? this.defaultActionButton
if (button === 'qgl' && !this.$store.getters['printer/existsQGL']) {
return this.defaultActionButton
}
if (button === 'ztilt' && !this.$store.getters['printer/existsZTilt']) {
return this.defaultActionButton
}
return button
}
get enableXYHoming(): boolean {
Expand Down
11 changes: 10 additions & 1 deletion src/components/panels/ToolheadControls/CrossControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,16 @@ export default class CrossControl extends Mixins(BaseMixin, ControlMixin) {
mdiHome = mdiHome
get actionButton(): string {
return this.$store.state.gui.control.actionButton ?? this.defaultActionButton
const button = this.$store.state.gui.control.actionButton ?? this.defaultActionButton
if (button === 'qgl' && !this.$store.getters['printer/existsQGL']) {
return this.defaultActionButton
}
if (button === 'ztilt' && !this.$store.getters['printer/existsZTilt']) {
return this.defaultActionButton
}
return button
}
/**
Expand Down

0 comments on commit e10f438

Please sign in to comment.