From d30800bb6fa43ccd4e3cf9d1e4ee16f51fcf702b Mon Sep 17 00:00:00 2001 From: CrispyBaguette Date: Sun, 12 Dec 2021 18:27:19 +0100 Subject: [PATCH] Header --- client/src/App.tsx | 14 ++++++++++---- client/src/Header.tsx | 14 +++++++++++++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index bb22eb8..ab606ee 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1,7 +1,7 @@ import React from "react"; import ImageInput from "./ImageInput"; import ImageOutput from "./ImageOutput"; -import Ditherer from "./Ditherer"; +import Ditherer from "./lib/Ditherer"; import ImagePreview from "./ImagePreview"; import Header from "./Header"; @@ -19,9 +19,15 @@ function App() { const handleImageSubmit = async (data: Uint8ClampedArray) => { setBaseImage(data); setAppState(AppState.IMAGE_LOADED); - const ditheredImage = await new Ditherer().dither(data); - setDitheredImage(ditheredImage); - setAppState(AppState.IMAGE_PROCESSED); + + try { + const ditheredImage = await new Ditherer().dither(data); + setDitheredImage(ditheredImage); + setAppState(AppState.IMAGE_PROCESSED); + } catch (e) { + console.error(e); + window.alert("Something went wrong. Please try again."); + } }; return ( diff --git a/client/src/Header.tsx b/client/src/Header.tsx index 235db06..ea7de5d 100644 --- a/client/src/Header.tsx +++ b/client/src/Header.tsx @@ -4,7 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; function Header() { return ( -
+
+ + Powered by{" "} + + IPFS + + . Visit using your own node ! +
); }