Skip to content

Commit

Permalink
bugfix: fix gcode thumbnail on dashboard
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <meteyou@gmail.com>
  • Loading branch information
meteyou committed Sep 1, 2020
1 parent d3c3113 commit ac01dce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/panels/StatusPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
<v-row>
<v-col
class="col-12 pv-0 col-sm-4 pr-sm-0"
v-if="current_file_metadata &&
v-if="
['printing', 'paused', 'complete'].includes(printer_state) &&
current_file_metadata &&
current_file_metadata.thumbnails &&
current_file_metadata.thumbnails.length &&
current_file_metadata.thumbnails.find(element => element.width === 400)
Expand All @@ -39,7 +41,8 @@
</v-col>
<v-col
:class="
(current_file_metadata &&
(['printing', 'paused', 'complete'].includes(printer_state) &&
current_file_metadata &&
current_file_metadata.thumbnails &&
current_file_metadata.thumbnails.length &&
current_file_metadata.thumbnails.find(element => element.width === 400)) ? 'col-12 pv-0 col-sm-8 pl-sm-0' : 'col-12 pv-0'
Expand Down
1 change: 1 addition & 0 deletions src/store/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ export default {

setMetadataCurrentFile(state, data) {
if (data !== undefined && data.filename !== "") {
state.printer.current_file.thumbnails = [];
Vue.set(state.printer, 'current_file', data);
}
},
Expand Down

0 comments on commit ac01dce

Please sign in to comment.