Skip to content

Commit

Permalink
fix: show errors
Browse files Browse the repository at this point in the history
  • Loading branch information
darlanalves authored Oct 23, 2023
1 parent deaa2f9 commit 9199b04
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,19 @@
lastStamp = Date.now();
}

function stopChange() {
const elapsed = Date.now() - lastStamp;

if (elapsed > props.resetTimeout) {
main.style.backgroundColor = theme.content = "#ffffff";
reset();
return;
async function stopChange() {
try {
const elapsed = Date.now() - lastStamp;

if (elapsed > props.resetTimeout) {
main.style.backgroundColor = theme.content = "#ffffff";
return await reset();
}

await changeColor();
} catch (e) {
document.getElementById('app').innerHTML += String(e);
}

changeColor();
}

main.onmousedown = main.ontouchstart = startChange;
Expand Down

0 comments on commit 9199b04

Please sign in to comment.