Skip to content

Commit

Permalink
Fix routing with history weird BS!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
UnsignedArduino committed Jan 13, 2024
1 parent 7447d9d commit 1ac6b51
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ LayoutProps): JSX.Element {
const baseURL = (() => {
switch (appProps.environment) {
case "production": {
return "https://awesome-arcade-extensions.vercel.app";
return "https://awesome-arcade.vercel.app";
}
case "preview": {
return "https://awesome-arcade-extensions-beta.vercel.app";
return "https://awesome-arcade-beta.vercel.app";
}
case "development": {
return "http://localhost:3000";
Expand Down
9 changes: 9 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Adsense from "../components/Adsense";
import Analytics from "../components/Analytics";
import ErrorBoundary from "../components/ErrorBoundary";
import { SessionProvider } from "next-auth/react";
import { useRouter } from "next/router";

export default function AwesomeArcadeExtensions({
Component,
Expand All @@ -17,6 +18,14 @@ export default function AwesomeArcadeExtensions({
import("bootstrap");
}, []);

const router = useRouter();

React.useEffect(() => {
window.addEventListener("popstate", () => {
router.push(window.location.href);
});
}, [router]);

return (
<ErrorBoundary>
<NextNProgress color="#FFF603" options={{ showSpinner: false }} />
Expand Down

0 comments on commit 1ac6b51

Please sign in to comment.