upgrades
This commit is contained in:
@@ -2,7 +2,7 @@ import "@/styles/globals.css";
|
||||
import { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Rhai Playground",
|
||||
title: "Minimax",
|
||||
description: "An interactive Rhai scripting language playground",
|
||||
};
|
||||
|
||||
@@ -18,12 +18,6 @@ export default function RootLayout({
|
||||
}) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.materialdesignicons.com/5.3.45/css/materialdesignicons.min.css"
|
||||
/>
|
||||
</head>
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import dynamic from "next/dynamic";
|
||||
import { loadAllWasm } from "@/utils/wasmLoader";
|
||||
|
||||
const Playground = dynamic(() => import("@/components/Playground"), {
|
||||
ssr: false,
|
||||
@@ -20,14 +21,7 @@ const Playground = dynamic(() => import("@/components/Playground"), {
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
Loading{" "}
|
||||
<a
|
||||
href="https://github.com/rhaiscript/playground"
|
||||
target="_blank"
|
||||
>
|
||||
Rhai Playground
|
||||
</a>
|
||||
...
|
||||
Loading WASM...
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
@@ -35,12 +29,24 @@ const Playground = dynamic(() => import("@/components/Playground"), {
|
||||
|
||||
export default function Home() {
|
||||
const [isClient, setIsClient] = useState(false);
|
||||
const [isWasmLoaded, setIsWasmLoaded] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setIsClient(true);
|
||||
|
||||
// Load all WASM modules
|
||||
loadAllWasm()
|
||||
.then(() => {
|
||||
setIsWasmLoaded(true);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to load WASM modules:', error);
|
||||
// Still allow the app to load, but WASM features may not work
|
||||
setIsWasmLoaded(true);
|
||||
});
|
||||
}, []);
|
||||
|
||||
if (!isClient) {
|
||||
if (!isClient || !isWasmLoaded) {
|
||||
return (
|
||||
<div
|
||||
id="loading"
|
||||
|
||||
Reference in New Issue
Block a user