fix: resolves issue related ops not flowing from search box to panel (#1918)

This commit is contained in:
Amol Umbark 2022-12-26 20:31:50 +05:30 committed by GitHub
parent 6f6499c267
commit 4b13b0a8a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,14 @@ function SearchFields({
const keyPrefixRef = useRef(hashCode(JSON.stringify(fieldsQuery)));
useEffect(() => {
setFieldsQuery(createParsedQueryStructure([...parsedQuery] as never[]));
const updatedFieldsQuery = createParsedQueryStructure([
...parsedQuery,
] as never[]);
setFieldsQuery(updatedFieldsQuery);
const incomingHashCode = hashCode(JSON.stringify(updatedFieldsQuery));
if (incomingHashCode !== keyPrefixRef.current) {
keyPrefixRef.current = incomingHashCode;
}
}, [parsedQuery]);
const addSuggestedField = useCallback(