Browse Source

use requestAnimationFrame on desktop

Evan Almloff 1 year ago
parent
commit
71f7481ded
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/desktop/build.rs

+ 3 - 1
packages/desktop/build.rs

@@ -44,7 +44,9 @@ fn main() {
           .then(response => {{
               response.arrayBuffer()
                   .then(bytes => {{
-                      run_from_bytes(bytes);
+                      requestAnimationFrame(() => {{
+                        run_from_bytes(bytes);
+                      }});
                       window.interpreter.wait_for_request();
                   }});
           }})