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(control): check set actionButton before display it #1953

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
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
meteyou marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
Loading