Skip to content

Commit

Permalink
fix(web): prompt onboarding only for users registered after today (#6200
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ChmaraX authored Jul 31, 2024
1 parent c36094d commit 4211cb1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions apps/web/src/ApplicationReadyGuard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,19 @@ export function ApplicationReadyGuard({ children }: PropsWithChildren<{}>) {

function isOnboardingComplete() {
if (IS_EE_AUTH_ENABLED) {
// TODO: replace with actual check property (e.g. isOnboardingCompleted)
return currentOrganization?.productUseCases !== undefined || currentOrganization?.language !== undefined;
if (!currentOrganization) {
return true;
}

const createdBefore =
currentOrganization?.createdAt && new Date(currentOrganization.createdAt) < new Date('2024-07-31');

// Prompt organizations to complete onboarding if created on or after 2024-07-31
if (!createdBefore) {
return currentOrganization?.productUseCases !== undefined || currentOrganization?.language !== undefined;
}

return true;
}

return currentOrganization;
Expand Down

0 comments on commit 4211cb1

Please sign in to comment.