Skip to content

Commit

Permalink
fix: confidence mode not saved after changing stop on error mode (moh…
Browse files Browse the repository at this point in the history
…anadft) (#4667)

* fix: save confidence mode after setting stopOnError and vice versa

* refactor: save to local storage if values updated

* fix: save freedomMode when it's reset
  • Loading branch information
mohanadft committed Sep 26, 2023
1 parent 923f69a commit 619bc23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/ts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ export function setStopOnError(
config.stopOnError = soe;
if (config.stopOnError !== "off") {
config.confidenceMode = "off";
saveToLocalStorage("confidenceMode", nosave);
}
saveToLocalStorage("stopOnError", nosave);
ConfigEvent.dispatch("stopOnError", config.stopOnError, nosave);
Expand Down Expand Up @@ -1284,6 +1285,8 @@ export function setConfidenceMode(
if (config.confidenceMode !== "off") {
config.freedomMode = false;
config.stopOnError = "off";
saveToLocalStorage("freedomMode", nosave);
saveToLocalStorage("stopOnError", nosave);
}
saveToLocalStorage("confidenceMode", nosave);
ConfigEvent.dispatch("confidenceMode", config.confidenceMode, nosave);
Expand Down

0 comments on commit 619bc23

Please sign in to comment.