Browse Source

Merge pull request #28 from naturalethic/fix-app-start-in-release

Call wasm main if debug start is missing
YuKun Liu 3 năm trước cách đây
mục cha
commit
59b073fda3
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      src/assets/index.html

+ 5 - 1
src/assets/index.html

@@ -12,7 +12,11 @@
     <!-- Note the usage of `type=module` here as this is an ES6 module -->
     <script type="module">
       import init from "./assets/dioxus/{app_name}.js";
-      init("./assets/dioxus/{app_name}_bg.wasm");
+      init("./assets/dioxus/{app_name}_bg.wasm").then(wasm => {
+        if (wasm.__wbindgen_start == undefined) {
+          wasm.main();
+        }
+      });
     </script>
     {script_include}
   </body>