Skip to content

Conversation

@innopoop
Copy link
Collaborator

@innopoop innopoop commented Aug 23, 2021

Requires respective backend change here

@vercel
Copy link

vercel bot commented Aug 23, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/novaforgood/risc/6RP1FXD36qZoRxEcvtJ5oxS9MaZm
✅ Preview: Failed

[Deployment for e83a798 failed]

@innopoop innopoop marked this pull request as draft August 23, 2021 21:40
Added localhost storage of step to preserve progress
Removed flash from redirection of onboarding
@innopoop innopoop marked this pull request as ready for review September 5, 2021 18:49
Copy link
Contributor

@alyssamw alyssamw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to approve after compile error is fixed and can see preview.

authorizationLevel !== AuthorizationLevel.Admin &&
router.asPath !== props.onboardingText[currentStep]["route"] &&
onboardingStep &&
typeof onboardingStep == "number"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this if condition mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there are a couple of different routes that require different onboarding but if a user navigates outside of the onboarding page (manually), then we have a way to counteract it because we check to see whether the user is still going through onboarding and if they are, we navigate them back to the designated onboarding step. The if statement, I don't know why I put authorizationLevel !== AuthorizationLevel.Admin I think that was a mistake, but the other conditions check for if the current path matches the step that you are supposed to be on and then it checks if the localstorage variable exists and is a number.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've corrected it :' )

};
};

export const OnboardingProvider = ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious as to why this is its own provider, am noob to it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it a provider because I wanted to share state among multiple pages, but I think it's also possible to make it a hook?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to a hook :' )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants