Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

fix: Parse JSON for updateSettings #911

Merged
merged 2 commits into from
Mar 28, 2019
Merged

Conversation

dpgraham
Copy link
Contributor

Need to parse 'settings' JSON before passing it through to wd

(cc: @wswebcreation)

@dpgraham dpgraham requested a review from jlipps March 28, 2019 19:48
@@ -51,6 +51,20 @@ export default class Actions extends Component {
}
}

// Special case for 'updateSettings'
if (action.methodName === 'updateSettings') {
if (_.isString(args[0])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if could be combined with the previous one using &&

args[0] = JSON.parse(args[0]);
} catch (e) {
notification.error({
message: t('invalidJson', {json: args[1]}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know that we have at least 2 args?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or it should be args[0]?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks.

@dpgraham dpgraham merged commit a4e9f7a into master Mar 28, 2019
@dpgraham dpgraham deleted the dpgraham-fix-update-settings branch March 28, 2019 22:49
@wswebcreation
Copy link
Contributor

Hi @dpgraham

Thanks for this fix. Is this already in the latest release? I tried this with the 1.12.0 and it still fails

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants