Skip to content

Commit

Permalink
fix: fix issue of empty Screws tilt adjust helper dialog (#1329)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Apr 1, 2023
1 parent ec1b32e commit 44f4079
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/components/dialogs/TheScrewsTiltAdjustDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
<v-card-text v-if="Object.keys(results).length">
<template v-for="(result, name, index) of results">
<v-divider v-if="index" :key="`result-divider-${name}`" class="my-1" />
<the-screws-tilt-adjust-dialog-entry :key="`result-${name}`" :name="name" :result="result" />
<the-screws-tilt-adjust-dialog-entry
:key="`result-${name}-${name}`"
:name="name"
:result="result" />
</template>
</v-card-text>
<v-card-actions>
Expand Down Expand Up @@ -50,14 +53,11 @@ import TheScrewsTiltAdjustDialogEntry from '@/components/dialogs/TheScrewsTiltAd
export default class TheScrewsTiltAdjustDialog extends Mixins(BaseMixin, ControlMixin) {
mdiArrowCollapseDown = mdiArrowCollapseDown
mdiCloseThick = mdiCloseThick
get state() {
return this.$store.state.printer.screws_tilt_adjust ?? {}
}
get error() {
return this.state.error ?? false
return this.$store.state.printer.screws_tilt_adjust?.error ?? false
}
get results() {
return this.state.results ?? {}
return this.$store.state.printer.screws_tilt_adjust?.results ?? {}
}
get showDialog() {
return this.error || Object.keys(this.results).length
Expand Down
2 changes: 1 addition & 1 deletion src/store/printer/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ export const mutations: MutationTree<PrinterState> = {

clearScrewsTiltAdjust(state) {
Vue.set(state.screws_tilt_adjust, 'error', false)
Vue.set(state.screws_tilt_adjust, 'results', [])
Vue.set(state.screws_tilt_adjust, 'results', {})
},
}

0 comments on commit 44f4079

Please sign in to comment.