diff --git a/INSTALLATION.md b/INSTALLATION.md index 1a7028dfab..a628a75d28 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -10,6 +10,7 @@ This document provides instructions on how to set up and start a running instanc - [Installation](#installation) - [Setting up this repository](#setting-up-this-repository) - [Setting up npm](#setting-up-npm) + - [Setting up Typescript](#setting-up-typescript) - [Installing required packages/dependencies](#installing-required-packagesdependencies) - [Configuration](#configuration) - [Creating .env file](#creating-env-file) @@ -25,8 +26,8 @@ This document provides instructions on how to set up and start a running instanc - [Debugging tests](#debugging-tests) - [Linting code files](#linting-code-files) - [Husky for Git Hooks](#husky-for-git-hooks) - - [pre-commit hook](#pre-commit-hook) - - [post-merge hook](#post-merge-hook) + - [pre-commit hook](#pre-commit-hook) + - [post-merge hook](#post-merge-hook) diff --git a/src/screens/LoginPage/LoginPage.tsx b/src/screens/LoginPage/LoginPage.tsx index b81b9c809c..98bb63a847 100644 --- a/src/screens/LoginPage/LoginPage.tsx +++ b/src/screens/LoginPage/LoginPage.tsx @@ -7,7 +7,7 @@ import Col from 'react-bootstrap/Col'; import Row from 'react-bootstrap/Row'; import ReCAPTCHA from 'react-google-recaptcha'; import { useTranslation } from 'react-i18next'; -import { Link } from 'react-router-dom'; +import { Link, useHistory } from 'react-router-dom'; import { toast } from 'react-toastify'; import { REACT_APP_USE_RECAPTCHA, RECAPTCHA_SITE_KEY } from 'Constant/constant'; @@ -26,6 +26,7 @@ import EmailOutlinedIcon from '@mui/icons-material/EmailOutlined'; function loginPage(): JSX.Element { const { t } = useTranslation('translation', { keyPrefix: 'loginPage' }); + const history = useHistory(); document.title = t('title'); @@ -51,7 +52,7 @@ function loginPage(): JSX.Element { useEffect(() => { const isLoggedIn = localStorage.getItem('IsLoggedIn'); if (isLoggedIn == 'TRUE') { - window.location.assign('/orglist'); + history.push('/orglist'); } setComponentLoader(false); }, []); @@ -196,7 +197,7 @@ function loginPage(): JSX.Element { localStorage.setItem('IsLoggedIn', 'TRUE'); localStorage.setItem('UserType', loginData.login.user.userType); if (localStorage.getItem('IsLoggedIn') == 'TRUE') { - window.location.replace('/orglist'); + history.push('/orglist'); } } else { toast.warn(t('notAuthorised'));