mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-25 01:06:16 -04:00
Changing the output encoding no longer triggers a full bake
This commit is contained in:
parent
406da9fa2c
commit
3893c22275
2 changed files with 14 additions and 5 deletions
|
@ -146,6 +146,8 @@ class OutputWaiter {
|
|||
*/
|
||||
chrEncChange(chrEncVal) {
|
||||
this.outputChrEnc = chrEncVal;
|
||||
// Reset the output, forcing it to re-decode the data with the new character encoding
|
||||
this.setOutput(this.currentOutputCache, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -173,10 +175,11 @@ class OutputWaiter {
|
|||
/**
|
||||
* Sets the value of the current output
|
||||
* @param {string|ArrayBuffer} data
|
||||
* @param {boolean} [force=false]
|
||||
*/
|
||||
setOutput(data) {
|
||||
setOutput(data, force=false) {
|
||||
// Don't do anything if the output hasn't changed
|
||||
if (data === this.currentOutputCache) return;
|
||||
if (!force && data === this.currentOutputCache) return;
|
||||
this.currentOutputCache = data;
|
||||
|
||||
// If data is an ArrayBuffer, convert to a string in the correct character encoding
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue