Skip to content
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: no requests before project loaded #7096

Merged
merged 2 commits into from
May 21, 2024

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented May 21, 2024

About the changes

Check if project is provided because we don't want hooks making 404 requests during initial data load for the project.

Important files

Discussion points

Copy link

vercel bot commented May 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 1:22pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview May 21, 2024 1:22pm

@@ -5,5 +5,5 @@ export const useShowDependentFeatures = (project: string) => {
const { dependenciesExist } = useCheckDependenciesExist(project);
const { isOss } = useUiConfig();

return Boolean(isOss() ? dependenciesExist : true);
return Boolean(project) && Boolean(isOss() ? dependenciesExist : true);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dependent features were checking pending change requests under the hood but they were checking them for the empty project. The empty project came from the placeholder used in useFeature. After this fix if the useFeature returns the placeholder project (with empty project) we don't show dependencies section.

featureId={feature.name}
onComplete={refetchFeature}
<ConditionallyRender
condition={Boolean(feature.project)}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same guard for the mark completed. We need project since hooks inside the dialogue assume it's not empty

@kwasniew kwasniew requested a review from sjaanus May 21, 2024 13:12
@kwasniew kwasniew merged commit ce67c4d into main May 21, 2024
10 checks passed
@kwasniew kwasniew deleted the no-requests-before-project-loaded branch May 21, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants