Skip to content

Commit

Permalink
Fix release error due to later loading of extruder settings
Browse files Browse the repository at this point in the history
  • Loading branch information
smartin015 committed Apr 27, 2024
1 parent bfb2c13 commit adc9112
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion continuousprint/static/js/continuousprint_viewmodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ function CPViewModel(parameters) {
self.printerProfiles = parameters[3];
self.settings = parameters[4];
self.cpPrinterProfiles = CP_PRINTER_PROFILES;
self.extruders = ko.computed(function() { return self.printerProfiles.currentProfileData().extruder.count(); });
self.extruders = ko.computed(function() {
let cpd = self.printerProfiles.currentProfileData();
if (cpd) {
return cpd.extruder.count();
} else {
return 1;
}
});
self.status = ko.observable("Initializing...");
self.statusType = ko.observable("INIT");
self.active = ko.observable(false);
Expand Down Expand Up @@ -358,6 +365,9 @@ function CPViewModel(parameters) {
self.badMaterialCount(nbad);
self.hasSpoolManager(true);
}, function(statusCode, errText) {
if (statusCode !== 404) {
console.error(statusCode, errText);
}
self.hasSpoolManager(statusCode !== 404);
});

Expand Down
2 changes: 1 addition & 1 deletion continuousprint/templates/continuousprint_tab.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
Hint: Install the <a href="https://plugins.octoprint.org/plugins/SpoolManager/" target="_blank">SpoolManager</a> plugin to enable <a href="https://smartin015.github.io/continuousprint/material-selection/" target="_blank">material selection</a>.
</div>
<div class="hint" data-bind="visible: $root.hasSpoolManager() && $root.materials().length == 0">
Hint: Add spools, then reload to enable <a href="https://smartin015.github.io/continuousprint/material-selection/" target="_blank">material selection</a>.
Hint: Add spools with materials, then reload to enable <a href="https://smartin015.github.io/continuousprint/material-selection/" target="_blank">material selection</a>.
</div>
<button class="btn pull-right" data-bind="click: remove" title="delete set">
<i style="cursor: pointer" class="far fa-trash-alt"></i> Delete
Expand Down

0 comments on commit adc9112

Please sign in to comment.