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

fix: Fix plugin settings #627

Merged
merged 1 commit into from
Nov 14, 2022
Merged

fix: Fix plugin settings #627

merged 1 commit into from
Nov 14, 2022

Conversation

ChFlick
Copy link
Contributor

@ChFlick ChFlick commented Nov 14, 2022

Fixes #626

The main problem was that

config.set('plugins', {
  ...config.get('plugins'),
  [name]: values,
})

was called before the value of values was updated.
Solution: moved it to useEffect with the dependency of values.

Furthermore, the dropdown settings weren't rendered correctly as the Select Component expects one of the options as its value (like { label: 'string', value: 'string' }) and not just a string. So when a string option is used, find the corresponding option.

Copy link
Contributor

@dubisdev dubisdev left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@dubisdev dubisdev merged commit 27c3bb0 into master Nov 14, 2022
@ogustavo-pereira ogustavo-pereira deleted the fix-plugin-settings branch February 5, 2023 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix(settings): options component is broken.
2 participants