Skip to content

Commit

Permalink
Merge pull request #45 from concord-consortium/187361590-fix-stop-lis…
Browse files Browse the repository at this point in the history
…tening-to-changes

fix: Only response to CODAP data changes in dataset mode [PT-187361590]
  • Loading branch information
dougmartin authored Apr 5, 2024
2 parents be769b5 + 6e04d99 commit dd64fb7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hooks/use-codap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ export const useCODAP = ({onCODAPDataChanged, getGraph, setGraph}: UseCODAPOptio

const handleDataChanged = useCallback(async ({datasetName, collectionName, attributeName}: CODAPAttribute) => {
const values = await getValuesForAttribute(datasetName, collectionName, attributeName);
onCODAPDataChanged(values);
}, [onCODAPDataChanged]);
if (viewMode === "dataset") {
onCODAPDataChanged(values);
}
}, [onCODAPDataChanged, viewMode]);

const setPluginState = useCallback((values: any) => {
setLoadState("loaded");
Expand Down

0 comments on commit dd64fb7

Please sign in to comment.