handle missing umami

This commit is contained in:
CrispyBaguette 2023-10-08 11:25:41 +02:00
parent 7e1dc8c443
commit 607e7f44e9

View File

@ -26,12 +26,17 @@ function App() {
const ditheredImage = await new Ditherer().dither(imageArray, palette);
setDitheredImage(new Blob([ditheredImage], { type: "image/png" }));
setAppState(AppState.IMAGE_PROCESSED);
if ("umami" in window) {
(window as any).umami.track("image processed");
}
} catch (e) {
console.error(e);
window.alert("Something went wrong. Please try again.");
if ("umami" in window) {
(window as any).umami.track("processing error");
}
}
};
return (