Skip to content

Commit

Permalink
fix(client): file manager would fail to load subsequent printers with…
Browse files Browse the repository at this point in the history
…out current profile key
  • Loading branch information
NotExpectedYet committed Jun 19, 2022
1 parent 3e3aced commit 3951e66
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions client/js/pages/file-manager/file.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,28 @@ export const noFilesToShow = () => {
`;
};

export const printerProfileTemplate = (printer) => {
let defaultProfileString = "<i class=\"fas fa-cube\"></i> Couldn't find profile";

const { currentProfile } = printer;

if(!!currentProfile){
defaultProfileString = `<b>H:</b> ${printer.currentProfile.volume.height}mm x <b>W:</b> ${printer.currentProfile.volume.width}mm x <b>D:</b> ${printer.currentProfile.volume.depth}mm`
}

return `
<small class="pt-2 float-left">
${defaultProfileString}
</small>
<br><!--Fix for firefox-->
<small class="pt-2 pb-2 float-left"><i class="fas fa-pen"></i> <b>Extruders:</b>
${printer.currentProfile.extruder.count}
<b>Nozzle Size:</b>
${printer.currentProfile.extruder.nozzleDiameter}mm
</small>
`
}

export const printerTemplate = (printer, storageWarning, extruderList) => {
return `
<a
Expand Down Expand Up @@ -259,16 +281,8 @@ export const printerTemplate = (printer, storageWarning, extruderList) => {
<div class="row">
</div>
<small class="pt-2 float-left"
><i class="fas fa-cube"></i> <b>H:</b> ${printer.currentProfile.volume.height}mm x <b>W:</b> ${printer.currentProfile.volume.width}mm x <b>D:</b> ${printer.currentProfile.volume.depth}mm</small
><br><!--Fix for firefox-->
<small class="pt-2 pb-2 float-left"
><i class="fas fa-pen"></i> <b>Extruders:</b>
${printer.currentProfile.extruder.count}
<b>Nozzle Size:</b>
${printer.currentProfile.extruder.nozzleDiameter}mm</small
>
${extruderList}
${printerProfileTemplate(printer)}
${extruderList}
</div>
</div>
</a>
Expand Down

0 comments on commit 3951e66

Please sign in to comment.