mirror of
https://github.com/codeninjasgg/code-sensei.git
synced 2024-11-27 01:35:35 -05:00
Update app.js
This commit is contained in:
parent
662a64b067
commit
173daa0340
1 changed files with 10 additions and 1 deletions
|
@ -38,8 +38,12 @@ const actions = {
|
|||
document.querySelector(selectors.incompleteBtn).click();
|
||||
const textarea = document.querySelector(selectors.notesTextarea);
|
||||
textarea.focus();
|
||||
isTypingFeedback = true;
|
||||
const updateTextarea = setIdleTimeout(
|
||||
() => document.querySelector(selectors.submit).focus(),
|
||||
() => {
|
||||
document.querySelector(selectors.submit).focus();
|
||||
isTypingFeedback = false;
|
||||
},
|
||||
defaultIdleTimeout
|
||||
);
|
||||
textarea.addEventListener("keypress", updateTextarea);
|
||||
|
@ -84,6 +88,9 @@ const actions = {
|
|||
};
|
||||
|
||||
document.addEventListener("keypress", (event) => {
|
||||
if (isTypingFeedback) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
switch (event.key) {
|
||||
case "i":
|
||||
|
@ -122,4 +129,6 @@ const main = () => {
|
|||
actions.nextAssignment();
|
||||
};
|
||||
|
||||
let isTypingFeedback = false;
|
||||
|
||||
main();
|
||||
|
|
Loading…
Reference in a new issue