From 75de6c665dcd8c97aebb174c3a31bbc5194be672 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Mon, 25 Apr 2022 13:37:24 -0400 Subject: [PATCH] Moved window.print redefining at top level to prevent naming collision --- src/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 1c15adcde..38aba9a58 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -4,6 +4,7 @@ import ReactDOM from "react-dom"; import { TTheme as Theme, ThemeEvents, refreshTheme } from "./Themes/ui/Theme"; import { LoadingScreen } from "./ui/LoadingScreen"; import { initElectron } from "./Electron"; +import { AlertEvents } from "./ui/React/AlertManager"; initElectron(); globalThis["React"] = React; globalThis["ReactDOM"] = ReactDOM; @@ -34,3 +35,9 @@ function rerender(): void { return "Your work will be lost."; }; })(); + +(function () { + window.print = () => { + throw new Error("You accidentally called window.print instead of ns.print"); + }; +})();