Turn output tabs into progress bars!

This commit is contained in:
j433866 2019-06-10 15:39:21 +01:00
parent 5a52e5e9b3
commit 9d60ef5f72
5 changed files with 101 additions and 8 deletions

View file

@ -212,6 +212,24 @@ self.sendStatusMessage = function(msg) {
};
/**
* Send progress update to the app.
*
* @param {number} progress
* @param {number} total
*/
self.sendProgressMessage = function(progress, total) {
self.postMessage({
action: "progressMessage",
data: {
progress: progress,
total: total,
inputNum: self.inputNum
}
});
};
/**
* Send an option value update to the app.
*

View file

@ -204,6 +204,7 @@ class Recipe {
if (ENVIRONMENT_IS_WORKER()) {
self.sendStatusMessage(`Baking... (${i+1}/${this.opList.length})`);
self.sendProgressMessage(i + 1, this.opList.length);
}
if (op.flowControl) {