fix(charts): fields undefined bug (#1980)
This commit is contained in:
parent
ad726e6a94
commit
ecb2af8fd6
@ -8,7 +8,7 @@ const useFieldsById = (queryId: number) => {
|
|||||||
const chartQueryList = ctx?.data;
|
const chartQueryList = ctx?.data;
|
||||||
if (chartQueryList && Array.isArray(chartQueryList)) {
|
if (chartQueryList && Array.isArray(chartQueryList)) {
|
||||||
const currentQuery = chartQueryList.find((chartQuery) => chartQuery.id === queryId);
|
const currentQuery = chartQueryList.find((chartQuery) => chartQuery.id === queryId);
|
||||||
setFields(currentQuery?.fields);
|
setFields(currentQuery?.fields || []);
|
||||||
}
|
}
|
||||||
}, [queryId]);
|
}, [queryId]);
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user