From 15371adc3d550817663aabca6c2f4b76fd585e4f Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Mon, 7 Aug 2023 23:25:00 +0200 Subject: [PATCH] feat: hide screws tilt adjust dialog, when using MAX_DEVIATION (#1474) --- src/components/dialogs/TheScrewsTiltAdjustDialog.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/dialogs/TheScrewsTiltAdjustDialog.vue b/src/components/dialogs/TheScrewsTiltAdjustDialog.vue index caeaa9d8..fb16ba23 100644 --- a/src/components/dialogs/TheScrewsTiltAdjustDialog.vue +++ b/src/components/dialogs/TheScrewsTiltAdjustDialog.vue @@ -65,13 +65,21 @@ export default class TheScrewsTiltAdjustDialog extends Mixins(BaseMixin, Control return this.$store.state.printer.screws_tilt_adjust?.error ?? false } + get max_deviation() { + return this.$store.state.printer.screws_tilt_adjust?.max_deviation ?? null + } + get results() { return this.$store.state.printer.screws_tilt_adjust?.results ?? {} } get showDialog() { + // don't display the dialog, if the user disabled it in the UI settings if (!this.boolScrewsTiltAdjustDialog) return false + // don't display the dialog, if the user add the MAX_DEVIATION attribute to the SCREWS_TILT_CALCULATE command + if (this.max_deviation !== null) return false + return this.error || Object.keys(this.results).length }