feat(commandline): add back commands that quickly practise missed and slow words

This commit is contained in:
Miodec 2024-09-19 11:54:27 +02:00
parent c3b86ec9e2
commit 11aeb313ef

View file

@ -5,6 +5,43 @@ import * as Notifications from "../../elements/notifications";
import * as TestInput from "../../test/test-input";
import * as TestWords from "../../test/test-words";
import Config from "../../config";
import * as PractiseWords from "../../test/practise-words";
const practiceSubgroup: MonkeyTypes.CommandsSubgroup = {
title: "Practice words...",
list: [
{
id: "practiseWordsMissed",
display: "missed",
exec: (): void => {
PractiseWords.init("words", false);
TestLogic.restart({
practiseMissed: true,
});
},
},
{
id: "practiseWordsSlow",
display: "slow",
exec: (): void => {
PractiseWords.init("off", true);
TestLogic.restart({
practiseMissed: true,
});
},
},
{
id: "practiseWordsCustom",
display: "custom...",
exec: (options): void => {
PractiseWordsModal.show({
animationMode: "modalOnly",
modalChain: options.commandlineModal,
});
},
},
],
};
const commands: MonkeyTypes.Command[] = [
{
@ -34,15 +71,9 @@ const commands: MonkeyTypes.Command[] = [
},
{
id: "practiseWords",
display: "Practice words",
display: "Practice words...",
icon: "fa-exclamation-triangle",
opensModal: true,
exec: (options): void => {
PractiseWordsModal.show({
animationMode: "modalOnly",
modalChain: options.commandlineModal,
});
},
subgroup: practiceSubgroup,
available: (): boolean => {
return TestUI.resultVisible;
},