mirror of
https://github.com/gchq/CyberChef
synced 2025-12-15 07:43:22 +00:00
Avoid calling inputChange when setting encoding inside loadURIParams
Otherwise the debounce logic sometimes causes the input to be overriden by the previous value.
This commit is contained in:
@@ -502,7 +502,7 @@ class App {
|
|||||||
// Input Character Encoding
|
// Input Character Encoding
|
||||||
// Must be set before the input is loaded
|
// Must be set before the input is loaded
|
||||||
if (this.uriParams.ienc) {
|
if (this.uriParams.ienc) {
|
||||||
this.manager.input.chrEncChange(parseInt(this.uriParams.ienc, 10), true);
|
this.manager.input.chrEncChange(parseInt(this.uriParams.ienc, 10), true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output Character Encoding
|
// Output Character Encoding
|
||||||
|
|||||||
@@ -217,11 +217,13 @@ class InputWaiter {
|
|||||||
* @param {number} chrEncVal
|
* @param {number} chrEncVal
|
||||||
* @param {boolean} [manual=false]
|
* @param {boolean} [manual=false]
|
||||||
*/
|
*/
|
||||||
chrEncChange(chrEncVal, manual=false) {
|
chrEncChange(chrEncVal, manual=false, internal=false) {
|
||||||
if (typeof chrEncVal !== "number") return;
|
if (typeof chrEncVal !== "number") return;
|
||||||
this.inputChrEnc = chrEncVal;
|
this.inputChrEnc = chrEncVal;
|
||||||
this.encodingState = manual ? 2 : this.encodingState;
|
this.encodingState = manual ? 2 : this.encodingState;
|
||||||
this.inputChange();
|
if (!internal) {
|
||||||
|
this.inputChange();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user