From f6c8536d221648cf95978e920c7ca66001ef67b2 Mon Sep 17 00:00:00 2001 From: Bernardo Fontes Date: Mon, 1 Nov 2021 17:19:00 -0300 Subject: [PATCH] Main call shouldn't use async statement --- pyp5js/http/templates/view_sketch.html | 3 +-- pyp5js/templates/pyodide/target_sketch.js.template | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pyp5js/http/templates/view_sketch.html b/pyp5js/http/templates/view_sketch.html index 2f3044f6..445c951d 100644 --- a/pyp5js/http/templates/view_sketch.html +++ b/pyp5js/http/templates/view_sketch.html @@ -66,7 +66,7 @@ {% if live_run %} - + {% endif %} {% endblock %} @@ -171,7 +171,6 @@ {% endif %} } } - }); diff --git a/pyp5js/templates/pyodide/target_sketch.js.template b/pyp5js/templates/pyodide/target_sketch.js.template index d92a1e1b..5ea7e4f6 100644 --- a/pyp5js/templates/pyodide/target_sketch.js.template +++ b/pyp5js/templates/pyodide/target_sketch.js.template @@ -1692,6 +1692,5 @@ async function main() { runCode(); }; -document.addEventListener('DOMContentLoaded', async function() { - await main() -}, false); +// async method +main();