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

Add auto redirect for single organizations #67

Merged
merged 1 commit into from
Mar 19, 2024
Merged

Conversation

ajhenry
Copy link
Contributor

@ajhenry ajhenry commented Mar 18, 2024

A QoL improvement for when there is a only a single organization for a user. We auto navigate to pages when there is only one org.

@ajhenry ajhenry requested a review from a team as a code owner March 18, 2024 23:54
Copy link

@ipc103 ipc103 left a comment

Choose a reason for hiding this comment

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

Just one question, but otherwise looks good!

@@ -28,9 +30,14 @@ const Organizations: FC<OrganizationsProps> = () => {
}

getAllOrganizations(accessToken).then((orgs) => {
// When only one organization, redirect to that organization
if (orgs.length === 1) {
Copy link

Choose a reason for hiding this comment

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

Just to confirm since I'm not great at reasoning about when useEffect runs (I kind of miss componenetDidMount 🤣 🙃 ), this effectively only runs on first login, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This runs any time the page is loaded 😄

@ajhenry ajhenry merged commit a56d4e6 into main Mar 19, 2024
10 checks passed
@ajhenry ajhenry deleted the ajhenry/landing branch May 17, 2024 15:23
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.

2 participants