mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-10 13:44:27 +08:00
added bailout
This commit is contained in:
parent
2d27d7f4ea
commit
b0a5145a66
2 changed files with 17 additions and 4 deletions
|
@ -303,20 +303,30 @@ let commands = {
|
|||
{
|
||||
id: "bailOut",
|
||||
display: "Bail out...",
|
||||
subgroup: true,
|
||||
visible: false,
|
||||
exec: () => {
|
||||
currentCommands = {
|
||||
currentCommands.push({
|
||||
title: "Are you sure...",
|
||||
list: [
|
||||
{
|
||||
id: "bailOutNo",
|
||||
display: "Nevermind",
|
||||
exec: () => {
|
||||
hideCommandLine();
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "bailOutForSure",
|
||||
display: "Yes, im sure",
|
||||
display: "Yes, I am sure",
|
||||
exec: () => {
|
||||
bailout = true;
|
||||
showResult();
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
showCommandLine();
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -1169,7 +1179,7 @@ function updateSuggestedCommands() {
|
|||
}
|
||||
});
|
||||
if (foundcount > 0) {
|
||||
if (obj.visible !== false) obj.found = true;
|
||||
obj.found = true;
|
||||
} else {
|
||||
obj.found = false;
|
||||
}
|
||||
|
|
|
@ -1497,6 +1497,8 @@ function showResult(difficultyFailed = false) {
|
|||
|
||||
let afkDetected = kps === 0 ? true : false;
|
||||
|
||||
if (bailout) afkDetected = false;
|
||||
|
||||
if (difficultyFailed) {
|
||||
showNotification("Test failed", 2000);
|
||||
} else if (afkDetected) {
|
||||
|
@ -1537,6 +1539,7 @@ function showResult(difficultyFailed = false) {
|
|||
consistency: consistency,
|
||||
keyConsistency: keyConsistency,
|
||||
funbox: activeFunBox,
|
||||
bailedOut: bailout,
|
||||
};
|
||||
if (
|
||||
config.difficulty == "normal" ||
|
||||
|
|
Loading…
Reference in a new issue