not reverting practise missed if the test was restarted by practise missed. this one actually fixes #1424

This commit is contained in:
Jack 2021-05-14 15:14:53 +01:00
parent 826232d6ec
commit 0bf8112110
2 changed files with 12 additions and 3 deletions

View file

@ -30,7 +30,7 @@ export function init() {
CustomText.setIsWordRandom(true);
CustomText.setWord(Object.keys(TestStats.missedWords).length * 5);
TestLogic.restart();
TestLogic.restart(false, false, false, true);
before.mode = mode;
before.punctuation = punctuation;
before.numbers = numbers;

View file

@ -608,7 +608,12 @@ export async function init() {
}
}
export function restart(withSameWordset = false, nosave = false, event) {
export function restart(
withSameWordset = false,
nosave = false,
event,
practiseMissed = false
) {
if (TestUI.testRestarting || TestUI.resultCalculating) {
try {
event.preventDefault();
@ -670,7 +675,11 @@ export function restart(withSameWordset = false, nosave = false, event) {
$("#words").empty();
}
if (PractiseMissed.before.mode !== null && !withSameWordset) {
if (
PractiseMissed.before.mode !== null &&
!withSameWordset &&
!practiseMissed
) {
Notifications.add("Reverting to previous settings.", 0);
UpdateConfig.setMode(PractiseMissed.before.mode);
UpdateConfig.setPunctuation(PractiseMissed.before.punctuation);