@evergis/react 4.0.72 → 4.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.esm.js CHANGED
@@ -12183,12 +12183,16 @@ const useChartData = ({ element, type }) => {
12183
12183
  layerInfos,
12184
12184
  dataSources,
12185
12185
  ]);
12186
+ const isResolved = useMemo(() => !relatedAttributes?.length ||
12187
+ relatedAttributes
12188
+ .filter(({ chartAxis }) => chartAxis === "y")
12189
+ .every(({ dataSourceName }) => Array.isArray(getDataSource(dataSourceName, dataSources)?.features)), [relatedAttributes, dataSources]);
12186
12190
  const [data, setData] = useState(fetchedData);
12187
12191
  useEffect(() => {
12188
- if (!loading) {
12192
+ if (!loading && (fetchedData?.length || isResolved)) {
12189
12193
  setData(fetchedData);
12190
12194
  }
12191
- }, [loading, fetchedData]);
12195
+ }, [loading, fetchedData, isResolved]);
12192
12196
  return { data, loading };
12193
12197
  };
12194
12198