Skip to content

Commit e235099

Browse files
committed
polished landing screen to function properly even if the user goes back or forward in history
1 parent 6c4e929 commit e235099

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/components/HomeView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ const HomeView = ({}: Props) => {
5757
} else if (landingOrHome === "landing") {
5858
tempParams = ["/landing"];
5959
setIsLanding(true);
60-
} else {
61-
setIsLanding(false);
6260
}
6361
// loops through each segment and validates it individually
6462
for (let i = 0; i < URLSegments.length; i++) {

src/components/LandingPage.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ const LandingPage = ({ setIsLanding }: Props) => {
5454

5555
useEffect(() => {
5656
setCurrentPathContext(currentPath);
57-
if (firstRender) {
58-
setFirstRender(false);
59-
} else if (
57+
if (
6058
// If current path is 'complete', transition to HomeView
61-
currentPath.endsWith("/gamedev") ||
62-
currentPath.endsWith("/webdev")
59+
currentPath.includes("/gamedev") ||
60+
currentPath.includes("/webdev")
6361
) {
6462
setCurrBG(pixelFadeBG);
6563
setIsActivePage(false);

0 commit comments

Comments
 (0)