Skip to content

Commit

Permalink
Merge pull request #282 from acm-ucr/dev
Browse files Browse the repository at this point in the history
bump
  • Loading branch information
minhhdtran authored Nov 19, 2024
2 parents b769e3a + cd9d0ab commit 1e5bc1b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@ import Slides from "@/components/home/Slides";
const Home = () => {
useEffect(() => {
if (!sessionStorage.getItem("reloaded")) {
const reloadTimeout = setTimeout(() => {
const handleGlobalErrors = (message, source, lineno, colno, error) => {
console.error("Error detected:", message, source, lineno, colno, error);

sessionStorage.setItem("reloaded", "true");
window.location.reload();
}, 100);
setTimeout(() => {
window.location.reload();
}, 500);
return true;
};

window.onerror = handleGlobalErrors;

return () => {
clearTimeout(reloadTimeout);
window.onerror = null;
};
}
}, []);
Expand Down

0 comments on commit 1e5bc1b

Please sign in to comment.