Skip to content

[HOTFIX] hide terms for loggedout users#7191

Merged
kkartunov merged 2 commits intomasterfrom
hotfix-hide-terms-for-loggedout-users
Feb 27, 2026
Merged

[HOTFIX] hide terms for loggedout users#7191
kkartunov merged 2 commits intomasterfrom
hotfix-hide-terms-for-loggedout-users

Conversation

@vas3a
Copy link
Collaborator

@vas3a vas3a commented Feb 27, 2026

Hides the terms and conditions for logged out users

@vas3a vas3a changed the title Hotfix hide terms for loggedout users [HOTFIX] hide terms for loggedout users Feb 27, 2026
auth,
} = props;

const isLoggedIn = !_.isEmpty(auth && auth.tokenV3);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 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(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ 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 && (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ 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.

@kkartunov kkartunov merged commit 95d7d89 into master Feb 27, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants