Skip to content

Commit

Permalink
create account route not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysmithTTD committed Nov 21, 2024
1 parent c68c146 commit 61fe0d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/web/contexts/ParticipantProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ function ParticipantProvider({ children }: Readonly<{ children: ReactNode }>) {

const currentParticipantId = parsedParticipantId ?? parsedLastSelectedParticipantId;

// useEffect(() => {
// if (
// participant &&
// participant.status !== ParticipantStatus.Approved &&
// location.pathname !== '/account/pending'
// ) {
// navigate('/account/pending');
// }
// }, [location.pathname, navigate, participant]);
useEffect(() => {
if (
participant &&
participant.status !== ParticipantStatus.Approved &&
location.pathname !== '/account/pending'
) {
navigate('/account/pending');
}
}, [location.pathname, navigate, participant]);

useEffect(() => {
const loadParticipant = async () => {
Expand Down
2 changes: 2 additions & 0 deletions src/web/screens/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { AccountPendingRoute } from './accountPending';
import { DashboardRoute } from './dashboard';
import { makePrivateRoute, PortalRoute } from './routeUtils';
import { SelfReinviteRoute } from './selfReinvite';

export const Routes: PortalRoute[] = [
makePrivateRoute(DashboardRoute),
makePrivateRoute(AccountPendingRoute),

// Unauthenticated routes
SelfReinviteRoute,
Expand Down

0 comments on commit 61fe0d3

Please sign in to comment.