Skip to content

Commit

Permalink
fix: Only response to CODAP data changes in dataset mode [PT-187361590]
Browse files Browse the repository at this point in the history
Without this the view could update if the user went from dataset more to drawing mode through the main menu button.
  • Loading branch information
dougmartin committed Apr 5, 2024
1 parent 5e8c354 commit 6e04d99
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 6e04d99

Please sign in to comment.