🚸 Only unset feed/flow rate after request completion

This commit is contained in:
Gina Häußge committed 2020-05-15 19:10:37 +02:00
1 parent b0d3c4a512
commit 12d674882a
1 file changed
+20 -8
@@ -282,13 +282,19 @@ $(function() {
OctoPrint.printer.home(axis);
};
self.feedRateBusy = ko.observable(false);
self.feedRateResetter = ko.observable();
self.sendFeedRateCommand = function () {
var rate = _.parseInt(self.feedRate());
OctoPrint.printer.setFeedrate(rate);
self.feedRate(undefined);
self.feedRateBusy(true);
OctoPrint.printer.setFeedrate(rate)
.done(function() {
self.feedRate(undefined);
})
.always(function() {
self.feedRateBusy(false);
});
};
self.feedRateResetter = ko.observable();
self.resetFeedRateDisplay = function() {
self.cancelFeedRateDisplayReset();
self.feedRateResetter(setTimeout(function() {
@@ -312,13 +318,19 @@ $(function() {
self._sendECommand(-1);
};
self.flowRateBusy = ko.observable(false);
self.flowRateResetter = ko.observable();
self.sendFlowRateCommand = function () {
var rate = _.parseInt(self.flowRate());
OctoPrint.printer.setFlowrate(rate);
self.flowRate(undefined);
self.flowRateBusy(true);
OctoPrint.printer.setFlowrate(rate)
.done(function() {
self.flowRate(undefined);
})
.always(function() {
self.flowRateBusy(false);
});
};
self.flowRateResetter = ko.observable();
self.resetFlowRateDisplay = function() {
self.cancelFlowRateDisplayReset();
self.flowRateResetter(setTimeout(function() {