Fixed pre commit failing tests
@@ -28,7 +28,7 @@ function App() {
const [isLoading, setIsLoading] = useState(false);
/*
- * Start a new session when component mounts on the browser.
+ * Start a new session when component mounts in the browser.
* It collects CompilerGym variables
*/
useEffect(() => {
@@ -54,11 +54,9 @@ function App() {
}, []);
useEffect(() => {
- window.addEventListener("beforeunload", alertUser);
- window.addEventListener("unload", handleTabClosing);
+ window.addEventListener("beforeunload", handleTabClosing);
return () => {
- window.removeEventListener("beforeunload", alertUser);
- window.removeEventListener("unload", handleTabClosing);
+ window.removeEventListener("beforeunload", handleTabClosing);
};
});
@@ -84,11 +82,6 @@ function App() {
);
};
- const alertUser = (event) => {
- event.preventDefault();
- event.returnValue = "";
- };
-
const toggleTheme = () => {
setDarkTheme(!darkTheme);
};
