Skip to content

Commit

Permalink
Move logic
Browse files Browse the repository at this point in the history
  • Loading branch information
DMS Host committed Jun 24, 2024
1 parent e6910c6 commit cc40be8
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ function triggerRead() {
ndef.addEventListener(
"reading",
(event) => {
console.log("reading");
const paragraph = document.createElement("p");
paragraph.textContent = "Scanned an Item!";
content.appendChild(paragraph);
},
{ once: false },
);
Expand All @@ -28,17 +30,6 @@ function triggerRead() {
await ndef.scan();

count++;

const paragraph = document.createElement("p");
paragraph.textContent = "Scanned an Item!"
content.appendChild(paragraph);
const sleepTimer = new Promise((resolve) => {
setTimeout(() => {
resolve();
}, 500);
});

await sleepTimer;
}
}

Expand Down

0 comments on commit cc40be8

Please sign in to comment.