Skip to content

Commit

Permalink
refactor: combine 2 if conditionals
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Jul 28, 2024
1 parent e10f438 commit c68d383
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/panels/ToolheadControls/CrossControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,10 @@ export default class CrossControl extends Mixins(BaseMixin, ControlMixin) {
get actionButton(): string {
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']) {
if (
(button === 'qgl' && !this.$store.getters['printer/existsQGL']) ||
(button === 'ztilt' && !this.$store.getters['printer/existsZTilt'])
) {
return this.defaultActionButton
}
Expand Down

0 comments on commit c68d383

Please sign in to comment.