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 overwriting the partial config on changing the language field #509

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

nandhinibsn
Copy link
Contributor

@nandhinibsn nandhinibsn commented Mar 22, 2023

Resolve #

Description:

Checklist:

You should check all boxes before the PR is ready. If a box does not apply, check it to acknowledge it.

  • ISSUE NUMBER. You linked the issue number (Ex: Resolve #XXX).
  • PRE-COMMIT. You ran pre-commit on all commits, or else, you
    ran pre-commit run --all-files at the end.
  • USER CHANGES. The changes are added to CHANGELOG.md and the documentation, if they impact
    our users.
  • DEV CHANGES.
    • Update the documentation if this PR changes how to develop/launch on the app.
    • Update the README files and our wiki for any big design decisions, if relevant.
    • Add unit tests, docstrings, typing and comments for complex sections.

@nandhinibsn nandhinibsn self-assigned this Mar 22, 2023
Copy link
Contributor

@JosephMarinier JosephMarinier left a comment

Choose a reason for hiding this comment

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

Thank you! 👍

@JosephMarinier JosephMarinier enabled auto-merge (squash) March 22, 2023 18:26
@JosephMarinier JosephMarinier merged commit 5060b40 into main Mar 22, 2023
@JosephMarinier JosephMarinier deleted the nandhini/fix-language-field-bug branch March 22, 2023 19:02
@@ -251,6 +251,7 @@ const Settings: React.FC<Props> = ({ open, onClose }) => {
React.useEffect(() => {
if (defaultConfig && defaultConfig.language !== resultingConfig.language) {
setPartialConfig({
...partialConfig,
Copy link
Contributor

Choose a reason for hiding this comment

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

We forgot to add partialConfig to the dependency array of React.useEffect. Can you make a quick commit with that?

src/pages/Settings.tsx
Line 285:6: React Hook React.useEffect has a missing dependency: 'partialConfig'. Either include it or remove the dependency array. You can also do a functional update 'setPartialConfig(p => ...)' if you only need 'partialConfig' in the 'setPartialConfig' call react-hooks/exhaustive-deps

Copy link
Contributor Author

@nandhinibsn nandhinibsn Mar 24, 2023

Choose a reason for hiding this comment

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

Sorry for missing this. Sure, I can add it to this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect, thank you!

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.

None yet

2 participants