From 56b9e8bf5052f7a9e49a8184fe069f1f005fc4c6 Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Thu, 23 Nov 2023 11:02:22 -0500 Subject: [PATCH] clean up --- frontend/src/App.tsx | 26 +++++++++++++------------- frontend/src/generateCode.ts | 1 - 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4bb0728..6455999 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -29,7 +29,7 @@ import { OnboardingNote } from "./components/OnboardingNote"; import { usePersistedState } from "./hooks/usePersistedState"; import { UrlInputSection } from "./components/UrlInputSection"; import TermsOfServiceDialog from "./components/TermsOfServiceDialog"; -import html2canvas from 'html2canvas'; +import html2canvas from "html2canvas"; import { USER_CLOSE_WEB_SOCKET_CODE } from "./constants"; function App() { @@ -53,15 +53,17 @@ function App() { const wsRef = useRef(null); const takeScreenshot = async (): Promise => { - const iframeElement = document.querySelector('#preview-desktop') as HTMLIFrameElement; + const iframeElement = document.querySelector( + "#preview-desktop" + ) as HTMLIFrameElement; if (!iframeElement?.contentWindow?.document.body) { - return ''; + return ""; } const canvas = await html2canvas(iframeElement.contentWindow.document.body); - const png = canvas.toDataURL('image/png'); + const png = canvas.toDataURL("image/png"); return png; - } + }; const downloadCode = () => { // Create a blob from the generated code @@ -91,8 +93,8 @@ function App() { const stop = () => { wsRef.current?.close?.(USER_CLOSE_WEB_SOCKET_CODE); // make sure stop can correct the state even if the websocket is already closed - setAppState(AppStatus.CODE_READY); - } + setAppState(AppState.CODE_READY); + }; function doGenerateCode(params: CodeGenerationParams) { setExecutionConsole([]); @@ -204,13 +206,11 @@ function App() { {appState === AppState.CODE_READY && (
-
-
- Auto Image Comparison -
+
+
Auto Image Comparison