Skip to content

Commit 4c1f917

Browse files
authored
Fire cove_loaded event after chart loads (#1957)
1 parent bf98601 commit 4c1f917

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/chart/src/CdcChartComponent.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,11 @@ const CdcChart: React.FC<CdcChartProps> = ({
424424
* When cove has a config and container ref publish the cove_loaded event.
425425
*/
426426
useEffect(() => {
427-
if (container && !_.isEmpty(config) && !coveLoadedEventRan) {
427+
if (container && !isLoading && !_.isEmpty(config) && !coveLoadedEventRan) {
428428
publish('cove_loaded', { config: config })
429429
dispatch({ type: 'SET_LOADED_EVENT', payload: true })
430430
}
431-
}, [container, config]) // eslint-disable-line
431+
}, [container, config, isLoading]) // eslint-disable-line
432432

433433
/**
434434
* Handles filter change events outside of COVE

packages/map/src/CdcMap.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1282,11 +1282,11 @@ const CdcMap = ({
12821282
}, []) // eslint-disable-line
12831283

12841284
useEffect(() => {
1285-
if (state && !coveLoadedHasRan && container) {
1285+
if (state && !runtimeData.init && !coveLoadedHasRan && container) {
12861286
publish('cove_loaded', { config: state })
12871287
setCoveLoadedHasRan(true)
12881288
}
1289-
}, [state, container]) // eslint-disable-line
1289+
}, [state, container, runtimeData.init]) // eslint-disable-line
12901290

12911291
useEffect(() => {
12921292
// When geotype changes - add UID

0 commit comments

Comments
 (0)