Skip to content

Commit 69d286e

Browse files
authored
fix(control): check set actionButton before display it (#1953)
1 parent 0bbf359 commit 69d286e

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/components/mixins/control.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ export default class ControlMixin extends Vue {
6464
return this.$store.getters['gui/getDefaultControlActionButton']
6565
}
6666

67+
get actionButton(): string {
68+
const button = this.$store.state.gui.control.actionButton ?? this.defaultActionButton
69+
70+
if (
71+
(button === 'qgl' && !this.$store.getters['printer/existsQGL']) ||
72+
(button === 'ztilt' && !this.$store.getters['printer/existsZTilt'])
73+
) {
74+
return this.defaultActionButton
75+
}
76+
77+
return button
78+
}
79+
6780
/**
6881
* Axes home states
6982
*/

src/components/panels/ToolheadControls/CircleControl.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,6 @@ export default class CircleControl extends Mixins(BaseMixin, ControlMixin) {
582582
engineOffIcon =
583583
'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'
584584
585-
get actionButton(): string {
586-
return this.$store.state.gui.control.actionButton ?? this.defaultActionButton
587-
}
588-
589585
get enableXYHoming(): boolean {
590586
return this.$store.state.gui.control.enableXYHoming
591587
}

src/components/panels/ToolheadControls/CrossControl.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,6 @@ export default class CrossControl extends Mixins(BaseMixin, ControlMixin) {
376376
mdiEngineOff = mdiEngineOff
377377
mdiHome = mdiHome
378378
379-
get actionButton(): string {
380-
return this.$store.state.gui.control.actionButton ?? this.defaultActionButton
381-
}
382-
383379
/**
384380
* Step size selection
385381
*/

0 commit comments

Comments
 (0)