Skip to content
Snippets Groups Projects
Commit a0a20f75 authored by Dima Rifai's avatar Dima Rifai Committed by mcfarhat
Browse files

Remove comments

parent 35061fc0
No related branches found
No related tags found
1 merge request!513Issue #415 - Refactor Events to prevent continous state changes causing slowness
Pipeline #112454 failed
......@@ -188,11 +188,11 @@ const SearchRanges: React.FC<SearchRangesProps> = ({
data-testid="headblock-number"
type="text"
defaultValue={toBlock || ""}
onChange={(e) => handleNumericInput(e)} // Keep cleaning logic here on change
onChange={(e) => handleNumericInput(e)}
placeholder={"To"}
onBlur={(e: React.FocusEvent<HTMLInputElement>) => {
const value = e.target.value;
const numericValue = value ? Number(value) : undefined; // Default to NaN if empty string
const numericValue = value ? Number(value) : undefined;
if (
numericValue &&
fromBlock &&
......@@ -201,13 +201,13 @@ const SearchRanges: React.FC<SearchRangesProps> = ({
numericValue < Number(fromBlock)
) {
setBlockRangeError("To block must be greater than From block");
e.target.value = ""; // Clear the 'toBlock' field if validation fails
e.target.value = "";
} else if (numericValue !=undefined && numericValue <= 0 && fromBlock) {
setBlockRangeError("To block must be greater than From block");
e.target.value = ""; // Clear the 'toBlock' field if validation fails
e.target.value = "";
} else {
setToBlock(numericValue); // Set the state only when validation passes
setBlockRangeError(null); // Clear error if valid
setToBlock(numericValue);
setBlockRangeError(null);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment