[HOTFIX] hide terms for loggedout users#7191
Conversation
| auth, | ||
| } = props; | ||
|
|
||
| const isLoggedIn = !_.isEmpty(auth && auth.tokenV3); |
There was a problem hiding this comment.
[💡 readability]
The expression auth && auth.tokenV3 is used to check if auth is defined before accessing auth.tokenV3. This is correct, but it could be simplified by using optional chaining: auth?.tokenV3. This would improve readability and reduce potential errors if auth is undefined.
| }; | ||
|
|
||
| ChallengeDetailsView.propTypes = { | ||
| auth: PT.shape(), |
There was a problem hiding this comment.
[maintainability]
The auth prop type is defined as PT.shape(), which does not specify any expected shape for the auth object. Consider defining the expected structure of the auth object to improve type safety and maintainability.
| registerForChallenge(auth, challengeId); | ||
| }} | ||
| /> | ||
| {isLoggedIn && ( |
There was a problem hiding this comment.
[❗❗ correctness]
The Terms component is now conditionally rendered based on the isLoggedIn flag. Ensure that isLoggedIn is correctly set to avoid unintended behavior where terms are not displayed to logged-in users.
Hides the terms and conditions for logged out users