-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat: select org profile on sign in #8859
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
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.
No issues found across 1 file
RomneyDa
left a comment
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.
There are some issues with this approach if cascadeInit runs into errors. Let's try to handle the selection change within the cascade init as opposed to clearing state outside of it. Maybe pass an isLogin boolean to cascadeInit?
core/config/ConfigHandler.ts
Outdated
| this.globalContext.get("lastSelectedOrgIdForWorkspace") ?? {}; | ||
| const currentSelection = selectedOrgs[workspaceId]; | ||
| // reset selected org to first available org on login, otherwise use saved selection | ||
| const currentSelection = isLogin ? null : selectedOrgs[workspaceId]; |
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.
@uinstinct this feels closer but it would still unnecessarily lose someone's org selection if they were logging in for the 2nd time.
I think you could change the line
if(currentSelection)
to if(currentSelection && !(login && currentSelection === "personal")
Or something that doesn't just cut out the current selection regardless of personal or not
Description
Select organization profile on sign in. If organization profile is not available, select the personal profile.
resolves CON-4960
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
before.mp4
after.mp4
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Automatically select the organization profile on sign in. If no org profile exists, fall back to the personal profile. Resolves CON-4960.
Written for commit aa0f50f. Summary will update automatically on new commits.