mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-20 07:16:17 +08:00
feat(commandline): add back commands that quickly practise missed and slow words
This commit is contained in:
parent
c3b86ec9e2
commit
11aeb313ef
|
@ -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;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue