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: fix issue of empty Screws tilt adjust helper dialog #1329

Merged
merged 1 commit into from
Apr 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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', {})
},
}