Skip to content

Commit

Permalink
Merge pull request #56 from uwblueprint/welcome_page_bug
Browse files Browse the repository at this point in the history
[Bug] Welcome Page Not Redirecting
  • Loading branch information
carolynzhang18 authored Aug 2, 2024
2 parents fabf01b + cc92fb3 commit 7ee24c2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions frontend/src/components/pages/Welcome.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import React from "react";
import { useHistory } from "react-router-dom";
import React, { useContext } from "react";
import { Redirect, useHistory } from "react-router-dom";
import { HOME_PAGE } from "../../constants/Routes";
import AuthContext from "../../contexts/AuthContext";

const Welcome = (): React.ReactElement => {
const { authenticatedUser } = useContext(AuthContext);
const history = useHistory();

if (authenticatedUser) {
return <Redirect to={HOME_PAGE} />;
}

const handleButtonClick = (selectedRole: string) => {
history.push(`/login?role=${selectedRole}`);
};
Expand Down

0 comments on commit 7ee24c2

Please sign in to comment.