mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -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
|
@ -55,6 +55,8 @@ class InputWaiter {
|
|||
this.maxWorkers = 1;
|
||||
if (navigator.hardwareConcurrency !== undefined &&
|
||||
navigator.hardwareConcurrency > 1) {
|
||||
// Subtract 1 from hardwareConcurrency value to avoid using
|
||||
// the entire available resources
|
||||
this.maxWorkers = navigator.hardwareConcurrency - 1;
|
||||
}
|
||||
}
|
||||
|
@ -223,17 +225,11 @@ class InputWaiter {
|
|||
this.manager.tabs.updateInputTabProgress(r.inputNum, 100, 100);
|
||||
}
|
||||
|
||||
if (r.hasOwnProperty("fileBuffer")) {
|
||||
this.inputWorker.postMessage({
|
||||
action: "loaderWorkerMessage",
|
||||
data: r
|
||||
}, [r.fileBuffer]);
|
||||
} else {
|
||||
this.inputWorker.postMessage({
|
||||
action: "loaderWorkerMessage",
|
||||
data: r
|
||||
});
|
||||
}
|
||||
const transferable = r.hasOwnProperty("fileBuffer") ? [r.fileBuffer] : undefined;
|
||||
this.inputWorker.postMessage({
|
||||
action: "loaderWorkerMessage",
|
||||
data: r
|
||||
}, transferable);
|
||||
}
|
||||
|
||||
|
||||
|
@ -318,7 +314,7 @@ class InputWaiter {
|
|||
*/
|
||||
bakeAll() {
|
||||
this.app.progress = 0;
|
||||
this.manager.controls.toggleBakeButtonFunction(false, true);
|
||||
this.manager.controls.toggleBakeButtonFunction("loading");
|
||||
this.inputWorker.postMessage({
|
||||
action: "bakeAll"
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue