-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Handle unauthenticated users when creating a new workspace #3578
Changes from all commits
592b9b1
ebcdc7e
268d05d
84c4b58
8f4b69e
659509d
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import Onyx from 'react-native-onyx'; | ||
import PropTypes from 'prop-types'; | ||
import ONYXKEYS from '../../ONYXKEYS'; | ||
import SCREENS from '../../SCREENS'; | ||
|
||
const propTypes = { | ||
/** react-navigation navigation object available to screen components */ | ||
navigation: PropTypes.shape({ | ||
/** Method used to navigate to a new page and not keep the current route in the history */ | ||
replace: PropTypes.func.isRequired, | ||
}).isRequired, | ||
}; | ||
|
||
class PublicWorkspaceNewView extends React.PureComponent { | ||
componentDidMount() { | ||
Onyx.merge(ONYXKEYS.SESSION, {redirectToWorkspaceNewAfterSignIn: true}); | ||
this.props.navigation.replace(SCREENS.HOME); | ||
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. Note: Had to use 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. Nice, that's interesting and I'd be curious to know more about why that is so we can standardize on |
||
} | ||
|
||
render() { | ||
return null; | ||
} | ||
} | ||
|
||
PublicWorkspaceNewView.propTypes = propTypes; | ||
|
||
export default PublicWorkspaceNewView; |
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.
I can see why this needed to be switched from
multiSet()
tomerge()
, but curious if there are reasons why we were using theset
behavior over themerge
behavior and if anything unexpected will come from this change (I'm not really sure so maybe it's a NAB - but sort of unclear why we used one over the other in the first place).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.
Yeah I was thinking about that, my assumption is that since it was done 7 months ago, we just didn't "need to" do
.merge
yet. I can keep an eye on issues related to Session storage in the next few weeks just in case