Fix status messages for baking
This commit is contained in:
parent
02bda3250b
commit
1cedc94652
@ -25,6 +25,7 @@ self.chef = new Chef();
|
|||||||
|
|
||||||
self.OpModules = OpModules;
|
self.OpModules = OpModules;
|
||||||
self.OperationConfig = OperationConfig;
|
self.OperationConfig = OperationConfig;
|
||||||
|
self.inputNum = -1;
|
||||||
|
|
||||||
|
|
||||||
// Tell the app that the worker has loaded and is ready to operate
|
// Tell the app that the worker has loaded and is ready to operate
|
||||||
@ -94,6 +95,7 @@ async function bake(data) {
|
|||||||
self.loadRequiredModules(data.recipeConfig);
|
self.loadRequiredModules(data.recipeConfig);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
self.inputNum = data.inputNum;
|
||||||
const response = await self.chef.bake(
|
const response = await self.chef.bake(
|
||||||
data.input, // The user's input
|
data.input, // The user's input
|
||||||
data.recipeConfig, // The configuration of the recipe
|
data.recipeConfig, // The configuration of the recipe
|
||||||
@ -127,6 +129,7 @@ async function bake(data) {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
self.inputNum = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -206,7 +209,8 @@ self.sendStatusMessage = function(msg) {
|
|||||||
self.postMessage({
|
self.postMessage({
|
||||||
action: "statusMessage",
|
action: "statusMessage",
|
||||||
data: {
|
data: {
|
||||||
message: msg
|
message: msg,
|
||||||
|
inputNum: self.inputNum || -1
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -83,8 +83,7 @@ class OutputWaiter {
|
|||||||
const newOutput = {
|
const newOutput = {
|
||||||
data: null,
|
data: null,
|
||||||
inputNum: inputNum,
|
inputNum: inputNum,
|
||||||
// statusMessage: `Input ${inputNum} has not been baked yet.`,
|
statusMessage: `Input ${inputNum} has not been baked yet.`,
|
||||||
statusMessage: "",
|
|
||||||
error: null,
|
error: null,
|
||||||
status: "inactive"
|
status: "inactive"
|
||||||
};
|
};
|
||||||
@ -356,6 +355,9 @@ class OutputWaiter {
|
|||||||
if (value) {
|
if (value) {
|
||||||
this.manager.controls.hideStaleIndicator();
|
this.manager.controls.hideStaleIndicator();
|
||||||
|
|
||||||
|
// Don't add the bombe if it's already there!
|
||||||
|
if (animation.children.length > 0) return;
|
||||||
|
|
||||||
// Start a timer to add the Bombe to the DOM just before we make it
|
// Start a timer to add the Bombe to the DOM just before we make it
|
||||||
// visible so that there is no stuttering
|
// visible so that there is no stuttering
|
||||||
this.appendBombeTimeout = setTimeout(function() {
|
this.appendBombeTimeout = setTimeout(function() {
|
||||||
|
@ -169,7 +169,6 @@ class WorkerWaiter {
|
|||||||
break;
|
break;
|
||||||
case "statusMessage":
|
case "statusMessage":
|
||||||
// Status message should be done per output
|
// Status message should be done per output
|
||||||
// log.error(r);
|
|
||||||
this.manager.output.updateOutputMessage(r.data.message, r.data.inputNum);
|
this.manager.output.updateOutputMessage(r.data.message, r.data.inputNum);
|
||||||
break;
|
break;
|
||||||
case "optionUpdate":
|
case "optionUpdate":
|
||||||
@ -305,7 +304,7 @@ class WorkerWaiter {
|
|||||||
|
|
||||||
log.debug(`Baking input ${nextInput.inputNum}.`);
|
log.debug(`Baking input ${nextInput.inputNum}.`);
|
||||||
this.manager.output.updateOutputStatus("baking", nextInput.inputNum);
|
this.manager.output.updateOutputStatus("baking", nextInput.inputNum);
|
||||||
this.manager.output.updateOutputMessage("Baking...", nextInput.inputNum);
|
this.manager.output.updateOutputMessage(`Baking input ${nextInput.inputNum}...`, nextInput.inputNum);
|
||||||
|
|
||||||
|
|
||||||
this.chefWorkers[workerIdx].inputNum = nextInput.inputNum;
|
this.chefWorkers[workerIdx].inputNum = nextInput.inputNum;
|
||||||
|
Loading…
Reference in New Issue
Block a user