Skip to content

Commit

Permalink
build: Update lara-interactive-api to latest version [PT-187855291]
Browse files Browse the repository at this point in the history
This was using a *very* old version but shockingly it worked.  This needs to be update to the latest version as the api is going to be updated to enable time series data sets.
  • Loading branch information
dougmartin committed Jun 26, 2024
1 parent cede052 commit 559020d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"webpack-dev-server": "^3.10.1"
},
"dependencies": {
"@concord-consortium/lara-interactive-api": "^0.7.1",
"@concord-consortium/lara-interactive-api": "^1.9.4",
"@concord-consortium/lara-plugin-api": "^3.1.2",
"@concord-consortium/token-service": "^1.2.0",
"@vernier/godirect": "^1.8.3",
Expand Down
29 changes: 16 additions & 13 deletions src/lara-app/hooks/interactive-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,23 @@ export const useInteractiveApi = (options: {setError: (error: any) => void}) =>
setConnectedToLara(true);

let _experiment;
let authoredState = data.authoredState;
// In authoring mode the authored state comes in as a string
// which causes the authoring preview to show an error
if (typeof authoredState === "string") {
try {
authoredState = JSON.parse(authoredState);
} catch (e) {
// noop

if (data.mode !== "reportItem") {
let authoredState = data.authoredState;
// In authoring mode the authored state comes in as a string
// which causes the authoring preview to show an error
if (typeof authoredState === "string") {
try {
authoredState = JSON.parse(authoredState);
} catch (e) {
// noop
}
}
if (authoredState?.version === "1.0") {
experimentId.current = authoredState.experimentId;
_experiment = findExperiment(authoredState.experimentId);
setExperiment(_experiment);
}
}
if (authoredState?.version === "1.0") {
experimentId.current = authoredState.experimentId;
_experiment = findExperiment(authoredState.experimentId);
setExperiment(_experiment);
}

let interactiveState: IInteractiveStateJSON | undefined;
Expand Down

0 comments on commit 559020d

Please sign in to comment.