-
Notifications
You must be signed in to change notification settings - Fork 41
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: pass in query param for role #374
Conversation
7738dc5
to
e18e894
Compare
e4e9b29
to
f44de3d
Compare
Lgtm. I'll test in a bit. |
f44de3d
to
3e2fb73
Compare
squashed |
const roleQueryParam = getQueryParam('role')?.toLowerCase(); | ||
if ( | ||
roleQueryParam && | ||
progress === SetupProgress.Start && |
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.
- line 93 is now redundant
- forcing
roleQueryParam
to lower case is a bug becausehttp://localhost:3000/?role=Host
never matches the include check oras GuardianRole
type coercion later
@@ -94,6 +112,7 @@ export const FederationSetup: React.FC = () => { | |||
title = t('setup.progress.tos.title'); | |||
content = <TermsOfService next={() => setNeedsTosAgreement(false)} />; | |||
} else { | |||
// Removed the roleQueryParam handling from here as it's moved to useEffect |
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.
we can delete the comment
@Kodylow when I was testing this, I found some bugs (tagged) but I actually took a step back wondering if we actually need to skip the first page because of query param. Might it be better to pre-select the role from the value of query param, but let the guardian click next to proceed? Here is a cherry pick from validating the issue 9a9503d |
I agree that's better, then people acknowledge their role too. will update. |
3e2fb73
to
441c9b8
Compare
Updated, made it way simpler too just a single useeffect in RoleSelector. |
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.
ship it!
Lets you pass in
role
as a query param so we can skip the first setup page, we've found it a hiccup when doing setups for fedi