Skip to content

Commit

Permalink
trying to debug prod 4
Browse files Browse the repository at this point in the history
  • Loading branch information
subru-37 committed Jan 12, 2025
1 parent 2f1bf20 commit dc3d152
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions apps/web-admin/src/components/ProtectedRoute.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ export const ProtectedRoute = ({ children }) => {
};
const { get, post } = useFetch();
// useEffect();
useEffect(() => {
//console.log(accountDetails);
if (
accountDetails &&
accountDetails.orgId &&
router.asPath !== `/${accountDetails.orgId}/events`
) {
// // //console.log('route')
router.replace(`/${accountDetails.orgId}/events`);
}
}, [isAuthenticated, accountDetails]);
// useEffect(() => {
// //console.log(accountDetails);
// if (
// accountDetails &&
// accountDetails.orgId &&
// router.asPath !== `/${accountDetails.orgId}/events`
// ) {
// // // //console.log('route')
// router.replace(`/${accountDetails.orgId}/events`);
// }
// }, [isAuthenticated, accountDetails]);
useEffect(() => {
// //console.log(accountDetails);
}, [accountDetails]);
Expand Down Expand Up @@ -94,6 +94,7 @@ export const ProtectedRoute = ({ children }) => {
});
//console.log('final: ', data);
setAccountDetails(data[0]);
router.replace(`/${data[0].orgId}/events`);
return data;
});
}
Expand Down

0 comments on commit dc3d152

Please sign in to comment.