fix(control): check set actionButton before display it (#1953)

This commit is contained in:
Stefan Dej 2024-11-05 22:52:04 +01:00 committed by GitHub
parent 0bbf35981b
commit 69d286ea70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 8 deletions

View File

@ -64,6 +64,19 @@ export default class ControlMixin extends Vue {
return this.$store.getters['gui/getDefaultControlActionButton']
}
get actionButton(): string {
const button = this.$store.state.gui.control.actionButton ?? this.defaultActionButton
if (
(button === 'qgl' && !this.$store.getters['printer/existsQGL']) ||
(button === 'ztilt' && !this.$store.getters['printer/existsZTilt'])
) {
return this.defaultActionButton
}
return button
}
/**
* Axes home states
*/

View File

@ -582,10 +582,6 @@ export default class CircleControl extends Mixins(BaseMixin, ControlMixin) {
engineOffIcon =
'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
}
get enableXYHoming(): boolean {
return this.$store.state.gui.control.enableXYHoming
}

View File

@ -376,10 +376,6 @@ export default class CrossControl extends Mixins(BaseMixin, ControlMixin) {
mdiEngineOff = mdiEngineOff
mdiHome = mdiHome
get actionButton(): string {
return this.$store.state.gui.control.actionButton ?? this.defaultActionButton
}
/**
* Step size selection
*/