Skip to content

Commit

Permalink
Update to prevent duplicated processing at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
OrigamiDream committed Nov 21, 2022
1 parent 977d90b commit 3830945
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions public/static/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ document.addEventListener('DOMContentLoaded', () => {
'성능/효과', '후속연구'
]

let processing = false;
presentation.addEventListener('click', () => {
if(processing) {
return;
}
const sentences = [
'본 연구는 전공계열에 따른 치과진료행태와 치과진료에 영향을 미치는 융합적 요인에 대하여 알아보고자 하였다.',
'가설 1: 옴니채널브랜드 체험은 옴니채널브랜드 신뢰에 정(+)의 영향을 미칠 것이다.',
Expand All @@ -23,6 +27,7 @@ document.addEventListener('DOMContentLoaded', () => {
]
function submit(index) {
if(index > sentences.length - 1) {
processing = false;
return;
}
document.getElementById('sentence').value = sentences[index];
Expand All @@ -33,6 +38,7 @@ document.addEventListener('DOMContentLoaded', () => {
}, 500);
}, 500);
}
processing = true;
submit(0);
});

Expand Down

0 comments on commit 3830945

Please sign in to comment.