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: save confidence mode after setting stopOnError and vice versa #4667

Merged
merged 4 commits into from
Sep 26, 2023

Conversation

mohanadft
Copy link
Contributor

@mohanadft mohanadft commented Sep 26, 2023

Description

Saving config to localStorage after resetting some values.

Closes #4638

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Sep 26, 2023
@mohanadft
Copy link
Contributor Author

mohanadft commented Sep 26, 2023

Hi @Miodec

  config.confidenceMode = cm;
  if (config.confidenceMode !== "off") {
    config.freedomMode = false;
    config.stopOnError = "off";
    saveToLocalStorage("stopOnError", nosave);
  }
  saveToLocalStorage("confidenceMode", nosave);

I think, in any of set functions, if the condition is true, you have to save all of what you are trying to reset?

@Miodec
Copy link
Member

Miodec commented Sep 26, 2023

I think, in any of set functions, if the condition is true, you have to save all of what you are trying to reset?

Not sure what you mean here, PR is good though

@mohanadft
Copy link
Contributor Author

Not sure what you mean here, PR is good though

In the code I attached above, freedomMode will be reset if the condition is true, should it be saved to localstorage after that? this is the same as confidenceMode & stopOnError

@Miodec
Copy link
Member

Miodec commented Sep 26, 2023

Yeah, ideally we should save everything that we change.

@mohanadft
Copy link
Contributor Author

Good, shall I save them on this PR?

@Miodec
Copy link
Member

Miodec commented Sep 26, 2023

Yeah

@mohanadft
Copy link
Contributor Author

mohanadft commented Sep 26, 2023

@Miodec You can merge now

@Miodec Miodec merged commit 619bc23 into monkeytypegame:master Sep 26, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend User interface or web stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When stop on word disables confidence mode, make sure confidence mode state is saved
3 participants