Fix for select&print not working for SD files anymore

Timing issue, "OctoPrint.job.start()" would be called at a time
when the file had not yet been selected on the server. Hence
a different approach, calculating printerAfterLoading parameter
based on existing information at the time of clicking the
load button and using the print parameter on the select
file API again, as previously.
This commit is contained in:
Gina Häußge 2016-11-16 14:12:00 +01:00
parent 174ffdf06f
commit c194cabdcf

View file

@ -402,13 +402,10 @@ $(function() {
if (!file) {
return;
}
OctoPrint.files.select(file.origin, file.path)
.done(function() {
var withinPrintDimensions = self.evaluatePrintDimensions(file, true);
if (withinPrintDimensions && printAfterLoad) {
OctoPrint.job.start();
}
});
var withinPrintDimensions = self.evaluatePrintDimensions(file, true);
var print = printAfterLoad && withinPrintDimensions;
OctoPrint.files.select(file.origin, file.path, print);
};
self.removeFile = function(file, event) {