-
Notifications
You must be signed in to change notification settings - Fork 432
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(comments): enable check #5918
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@@ -37,29 +41,22 @@ export function useFeatureEnabled(featureKey: string): Features { | |||
const {projectId} = useSource() | |||
|
|||
if (!cachedFeatureRequest.get(projectId)) { | |||
const features = fetchFeatures({versionedClient}).pipe( | |||
shareReplay(), | |||
catchError((error) => { |
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.
Removing the error catch here so that we can catch it below instead.
No changes to documentation |
Component Testing Report Updated Mar 6, 2024 3:49 PM (UTC)
|
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.
Thanks @hermanwikner !
* feat(core): add `error` to `useFeatureEnabled` * fix(comments): only enable comments if we are able to fetch project features
Description
This pull request ensures that we only display the upsell UI or the comments UI if we can successfully fetch the feature flags for the current project. If fetching the feature flags is not possible, for example, due to the current user's permissions restricting access to "project details," we cannot accurately determine which UI to display. Therefore, in such scenarios, we must disable the feature entirely to prevent inadvertently showing the upsell UI for a project where it is actually enabled.
What to review
studioComments
Notes for release
N/A