Skip to content
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

Merged
merged 2 commits into from
Nov 1, 2024
Merged

Conversation

dinmukhamedm
Copy link
Member

@dinmukhamedm dinmukhamedm commented Oct 31, 2024

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 using useRouter.

  • Behavior:
    • Redirects to /onboarding if data is defined and empty in Projects component.
  • Routing:
    • Uses useRouter from next/navigation to handle redirection.

This description was created by Ellipsis for 33a3965. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 in 1 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) {
Copy link
Contributor

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.

Suggested change
if (data !== undefined && data.length === 0) {
if (!isLoading && data !== undefined && data.length === 0) {

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 in 1 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 if data 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 of router.replace is appropriate for redirecting without adding a new entry to the history stack. However, the condition should ensure that data 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.

@dinmukhamedm dinmukhamedm merged commit 4ffe03d into dev Nov 1, 2024
1 check passed
@dinmukhamedm dinmukhamedm deleted the redirect-onboarding branch November 1, 2024 01:36
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.

1 participant