Skip to content

Commit

Permalink
try single stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
cea2aj committed May 7, 2021
1 parent 148666b commit 86042d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion static/js/get-injected-prop.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { isStaging } from './is-staging';
* @returns {any}
*/
export function getInjectedProp(experienceKey, propPath) {
const injectedData = JSON.parse(process.env.JAMBO_INJECTED_DATA || '{}');
const injectedData = process.env.JAMBO_INJECTED_DATA || {};
const experiences = injectedData?.answers?.experiences;
if (!experiences || !experiences[experienceKey]) {
return undefined;
Expand Down
2 changes: 1 addition & 1 deletion static/js/models/InjectedData.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class InjectedData {
/**
* @type {Object}
*/
this.injectedData = JSON.parse(process.env.JAMBO_INJECTED_DATA || '{}');
this.injectedData = process.env.JAMBO_INJECTED_DATA || {};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion static/webpack-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = function () {
new MiniCssExtractPlugin({ filename: '[name].css' }),
...htmlPlugins,
new webpack.DefinePlugin({
'process.env.JAMBO_INJECTED_DATA': JSON.stringify(JSON.stringify(updatedJamboInjectedData))
'process.env.JAMBO_INJECTED_DATA': JSON.stringify(updatedJamboInjectedData)
}),
new RemovePlugin({
after: {
Expand Down

0 comments on commit 86042d4

Please sign in to comment.