Moved window.print redefining at top level to prevent naming collision

This commit is contained in:
Olivier Gagnon 2022-04-25 13:37:24 -04:00
parent 2be1d5ff15
commit 75de6c665d

@ -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");
};
})();