Skip to content

Commit

Permalink
feat: stricter prompt
Browse files Browse the repository at this point in the history
adds reloading and several performance tweaks
fixes several bugs with rendering issues
  • Loading branch information
pixelass committed Apr 14, 2023
1 parent e5ae926 commit 9d1931d
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 216 deletions.
10 changes: 6 additions & 4 deletions public/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,20 @@ function answer(window_, channel, targetOrigin = "*") {
}

function handleTemplate(template) {
for (let i = 1; i < 100_000_000; i++) {
for (let i = 1; i < 1_000; i++) {
window.clearInterval(i);
window.cancelAnimationFrame(i);
window.clearTimeout(i);
}

Function("Template", `${template};`)();
try {
Function("Template", `${template};`)();
} catch (error) {
console.log(error);
}
}

subscribe("fail4", event => {
console.log("GUEST", event);
const { action } = event.data;
switch (action.type) {
case "call":
Expand All @@ -70,7 +73,6 @@ subscribe("fail4", event => {
handleTemplate(action.payload.template);
break;
case "broadcast":
console.log("broadcast", action.payload.template);
ctx.clearRect(0, 0, canvas.width, canvas.height);
handleTemplate(action.payload.template);
break;
Expand Down
2 changes: 0 additions & 2 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Head from "next/head";
import { AppProps } from "next/app";
import { ThemeProvider } from "@mui/material/styles";
import CssBaseline from "@mui/material/CssBaseline";
import { CacheProvider, EmotionCache } from "@emotion/react";
import theme from "@/lib/theme";
import createEmotionCache from "@/lib/createEmotionCache";
Expand All @@ -22,7 +21,6 @@ export default function MyApp(props: MyAppProps) {
</Head>
<ThemeProvider theme={theme}>
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
<CssBaseline />
<Component {...pageProps} />
</ThemeProvider>
</CacheProvider>
Expand Down
Loading

0 comments on commit 9d1931d

Please sign in to comment.