mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 17:29:03 +08:00
fix: on delete current query length should be more than 1 (#3125)
Co-authored-by: Vishal Sharma <makeavish786@gmail.com>
This commit is contained in:
parent
d26022efb1
commit
6b77165d09
@ -27,6 +27,7 @@ export const useQueryOperations: UseQueryOperations = ({
|
||||
removeQueryBuilderEntityByIndex,
|
||||
panelType,
|
||||
initialDataSource,
|
||||
currentQuery,
|
||||
} = useQueryBuilder();
|
||||
const [operators, setOperators] = useState<SelectOption<string, string>[]>([]);
|
||||
const [listOfAdditionalFilters, setListOfAdditionalFilters] = useState<
|
||||
@ -121,8 +122,10 @@ export const useQueryOperations: UseQueryOperations = ({
|
||||
);
|
||||
|
||||
const handleDeleteQuery = useCallback(() => {
|
||||
removeQueryBuilderEntityByIndex('queryData', index);
|
||||
}, [removeQueryBuilderEntityByIndex, index]);
|
||||
if (currentQuery.builder.queryData.length > 1) {
|
||||
removeQueryBuilderEntityByIndex('queryData', index);
|
||||
}
|
||||
}, [removeQueryBuilderEntityByIndex, index, currentQuery]);
|
||||
|
||||
const handleChangeQueryData: HandleChangeQueryData = useCallback(
|
||||
(key, value) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user