mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Fix stepping.
Move stepping logic into App. Change toggleBakeButtonFunction to use a str instead of booleans. Tidy up handleLoaderMessage in InputWaiter.
This commit is contained in:
parent
3dc57c4a4a
commit
a9f8dac656
5 changed files with 77 additions and 55 deletions
|
@ -166,6 +166,34 @@ class App {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Executes the next step of the recipe.
|
||||
*/
|
||||
step() {
|
||||
if (this.baking) return;
|
||||
|
||||
// Reset status using cancelBake
|
||||
this.manager.worker.cancelBake(true, false);
|
||||
|
||||
const activeTab = this.manager.tabs.getActiveInputTab();
|
||||
if (activeTab === -1) return;
|
||||
|
||||
let progress = 0;
|
||||
if (this.manager.output.outputs[activeTab].progress !== false) {
|
||||
log.error(this.manager.output.outputs[activeTab]);
|
||||
progress = this.manager.output.outputs[activeTab].progress;
|
||||
}
|
||||
|
||||
this.manager.input.inputWorker.postMessage({
|
||||
action: "step",
|
||||
data: {
|
||||
activeTab: activeTab,
|
||||
progress: progress + 1
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Runs a silent bake, forcing the browser to load and cache all the relevant JavaScript code needed
|
||||
* to do a real bake.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue