handle missing umami
This commit is contained in:
parent
7e1dc8c443
commit
607e7f44e9
@ -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 (
|
||||
|
Loading…
Reference in New Issue
Block a user