Skip to content
Snippets Groups Projects
Commit 37aacc90 authored by chrisgarrity's avatar chrisgarrity
Browse files

Handle intl prop correctly

The initial intl store expected an object with an `intl` key, not the intl object as returned by `injectIntl`.

Also changed GUI proptypes to accept Object as well as String for projectData to avoid warnings.
parent d0f5998f
Branches
Tags
No related merge requests found
......@@ -89,7 +89,7 @@ GUI.propTypes = {
importInfoVisible: PropTypes.bool,
loadingStateVisible: PropTypes.bool,
previewInfoVisible: PropTypes.bool,
projectData: PropTypes.string,
projectData: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
vm: PropTypes.instanceOf(VM)
};
......
......@@ -25,7 +25,20 @@ const AppStateHOC = function (WrappedComponent) {
class AppStateWrapper extends React.Component {
constructor (props) {
super(props);
this.store = createStore(reducer, (props.intl || intlInitialState), enhancer);
let intl = {};
if (props.intl) {
intl = {
intl: {
defaultLocale: 'en',
locale: props.intl.locale,
messages: props.intl.messages
}
};
} else {
intl = intlInitialState;
}
this.store = createStore(reducer, intl, enhancer);
}
componentDidUpdate (prevProps) {
if (prevProps.intl !== this.props.intl) updateIntl(this.props.intl);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment