Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Update lara-interactive-api to latest version [PT-187855291] #152

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading