mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-16 08:58:30 +01:00
Fixed deep copy bug with Fork/Register ingredient values.
This commit is contained in:
parent
eee8b7db56
commit
870c2b6d8b
2 changed files with 4 additions and 3 deletions
|
@ -55,7 +55,9 @@ const FlowControl = {
|
||||||
state.forkOffset += state.progress + 1;
|
state.forkOffset += state.progress + 1;
|
||||||
|
|
||||||
recipe.addOperations(subOpList);
|
recipe.addOperations(subOpList);
|
||||||
const ingValues = subOpList.map(op => op.getIngValues());
|
|
||||||
|
// Take a deep(ish) copy of the ingredient values
|
||||||
|
const ingValues = subOpList.map(op => JSON.parse(JSON.stringify(op.getIngValues())));
|
||||||
|
|
||||||
// Run recipe over each tranche
|
// Run recipe over each tranche
|
||||||
for (i = 0; i < inputs.length; i++) {
|
for (i = 0; i < inputs.length; i++) {
|
||||||
|
@ -63,7 +65,7 @@ const FlowControl = {
|
||||||
|
|
||||||
// Baseline ing values for each tranche so that registers are reset
|
// Baseline ing values for each tranche so that registers are reset
|
||||||
subOpList.forEach((op, i) => {
|
subOpList.forEach((op, i) => {
|
||||||
op.setIngValues(ingValues[i]);
|
op.setIngValues(JSON.parse(JSON.stringify(ingValues[i])));
|
||||||
});
|
});
|
||||||
|
|
||||||
const dish = new Dish(inputs[i], inputType);
|
const dish = new Dish(inputs[i], inputType);
|
||||||
|
|
|
@ -488,7 +488,6 @@ App.prototype.setRecipeConfig = function(recipeConfig) {
|
||||||
|
|
||||||
// Unpause auto bake
|
// Unpause auto bake
|
||||||
this.autoBakePause = false;
|
this.autoBakePause = false;
|
||||||
window.dispatchEvent(this.manager.statechange);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue