Skip to content

Commit

Permalink
refactor: history.push line
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhbizzle committed Jan 25, 2024
1 parent 333f39a commit 28c23f7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/screens/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ function loginPage({ role = 'user' }: InterfaceComponentProps): JSX.Element {
useEffect(() => {
const isLoggedIn = localStorage.getItem('IsLoggedIn');
if (isLoggedIn == 'TRUE') {
role === 'admin'
? history.push('/orglist')
: history.push('/user/organizations');
history.push(role === 'admin' ? '/orglist' : '/user/organizations');
}
setComponentLoader(false);
}, []);
Expand Down Expand Up @@ -310,7 +308,7 @@ function loginPage({ role = 'user' }: InterfaceComponentProps): JSX.Element {
navigator.clipboard.writeText('');
}
if (localStorage.getItem('IsLoggedIn') == 'TRUE') {
history.push(role === 'admin' ? '/orglist' : '/user/organizations/');
history.push(role === 'admin' ? '/orglist' : '/user/organizations');
}
} else {
toast.warn(t('notFound'));
Expand Down

0 comments on commit 28c23f7

Please sign in to comment.