Skip to content

fix: save confidence mode after setting stopOnError and vice versa#4667

Merged
Miodec merged 4 commits into
monkeytypegame:masterfrom
mohanadft:master
Sep 26, 2023
Merged

fix: save confidence mode after setting stopOnError and vice versa#4667
Miodec merged 4 commits into
monkeytypegame:masterfrom
mohanadft:master

Conversation

@mohanadft
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

Miodec commented Sep 26, 2023

Yeah, ideally we should save everything that we change.

@mohanadft
Copy link
Copy Markdown
Contributor Author

Good, shall I save them on this PR?

@Miodec
Copy link
Copy Markdown
Member

Miodec commented Sep 26, 2023

Yeah

@mohanadft
Copy link
Copy Markdown
Contributor Author

mohanadft commented Sep 26, 2023

@Miodec You can merge now

@Miodec Miodec merged commit 619bc23 into monkeytypegame:master Sep 26, 2023
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