-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix join workspace flow #39991
Fix join workspace flow #39991
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,10 +39,10 @@ function WorkspaceJoinUserPage({route, policy}: WorkspaceJoinUserPageProps) { | |
}, []); | ||
|
||
useEffect(() => { | ||
if (!policy || isUnmounted.current || isJoinLinkUsed) { | ||
if (isUnmounted.current || isJoinLinkUsed) { | ||
return; | ||
} | ||
if (!isEmptyObject(policy)) { | ||
if (!isEmptyObject(policy) && !policy?.isJoinRequestPending) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nkdengineer Why change here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DylanDylann After we request to join the workspace, policy will not be empty. So if we click the join link again, we will go to initial page. |
||
Navigation.isNavigationReady().then(() => { | ||
Navigation.goBack(undefined, false, true); | ||
Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policyID ?? '')); | ||
|
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.
@nkdengineer Why do you remove this condition
!policy
? Should we checkisEmptyObject(policy)
instead of removing itThere 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.
@DylanDylann In the past we use
getPolicy
function which returns empty object by default so the check!policy
is alwaysfalse
. Now, we're getpolicy
from Onyx so we should remove this check that is preventing join workspace flow.isEmptyObject(policy)
also returns true forundefined
ornull
.