-
Notifications
You must be signed in to change notification settings - Fork 60
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
redirect to onboarding if no workspaces yet #118
Conversation
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.
❌ Changes requested. Reviewed everything up to 3be7fb5 in 32 seconds
More details
- Looked at
24
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_UWm9ecWpnuo98Z3U
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -20,6 +21,11 @@ export default function Projects({ isWorkspaceEnabled }: ProjectsProps) { | |||
swrFetcher | |||
); | |||
|
|||
const router = useRouter(); | |||
if (data !== undefined && data.length === 0) { |
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.
Consider checking for isLoading
before redirecting to ensure data is fully loaded before making a decision.
if (data !== undefined && data.length === 0) { | |
if (!isLoading && data !== undefined && data.length === 0) { |
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.
👍 Looks good to me! Incremental review on 33a3965 in 6 seconds
More details
- Looked at
15
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. frontend/components/projects/projects.tsx:25
- Draft comment:
Consider checking ifdata
is not null or undefined before checking its length to avoid potential runtime errors. - Reason this comment was not posted:
Confidence changes required:50%
The use ofrouter.replace
is appropriate for redirecting without adding a new entry to the history stack. However, the condition should ensure thatdata
is not null or undefined before checking its length.
Workflow ID: wflow_NoE4LS1hDHuiQWaG
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Sometimes, onboarding flow breaks for people (e.g. signed in, then signed in from a different browser) and it is extremely difficult to figure out how to get started. This change redirects to onboarding if the user has 0 workspaces.
Important
Redirects to onboarding in
Projects
component if no workspaces are found usinguseRouter
./onboarding
ifdata
is defined and empty inProjects
component.useRouter
fromnext/navigation
to handle redirection.This description was created by for 33a3965. It will automatically update as commits are pushed.