-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dashboard,web): opt-in app switching and redirects #7002
Conversation
|
||
useEffect(() => { | ||
if (isLoaded && status !== NewDashboardOptInStatusEnum.OPTED_IN) { | ||
window.location.href = '/legacy/workflows'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using navigate()
here won't work since its external url
segment.track('New dashboard opt-in'); | ||
updateUserOptInStatus(NewDashboardOptInStatusEnum.OPTED_IN); | ||
await updateUserOptInStatus(NewDashboardOptInStatusEnum.OPTED_IN); | ||
localStorage.setItem('mantine-theme', 'light'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be set directly in local storage otherwise when using hook the operation seems to be async and can't be awaited
* | ||
* note: /legacy is part of public URL, so we can't navigate() outside of that | ||
*/ | ||
window.location.href = window.location.origin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now we redirect to the default page which is the workflows page - otherwise we would need to parse old env id to new env slugs to redirect to env/<env_slug>/workflows
- will do in separate PR if there is a hard requirement to keep env id
✅ Deploy Preview for novu-stg-vite-dashboard-poc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
What changed? Why was the change needed?