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: check if preview_branch_refs exists #19124

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Hallidayo
Copy link
Contributor

What kind of change does this PR introduce?

Bug Fix - Local Dev

What is the current behavior?

Running the development version of Supabase if you go to the main projects dashboard this error is appearing:

Screenshot 2023-11-19 at 17 35 35

What is the new behavior?

Added a check for the variable and now the page loads without error.

Additional context

@MildTomato

@Hallidayo Hallidayo requested a review from a team as a code owner November 21, 2023 12:37
Copy link

vercel bot commented Nov 21, 2023

@Hallidayo is attempting to deploy a commit to the Supabase Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Nov 21, 2023

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

Name Status Preview Comments Updated (UTC)
database-new ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2023 8:26pm
studio-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2023 8:26pm
5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2023 8:26pm
studio ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2023 8:26pm
studio-self-hosted ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2023 8:26pm
ui-storybook ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2023 8:26pm
zone-www-dot-com ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2023 8:26pm

@@ -25,7 25,7 @@ const ProjectCard = ({
const { name, ref: projectRef } = project
const desc = `${project.cloud_provider} | ${project.region}`

const isBranchingEnabled = project.preview_branch_refs.length > 0
const isBranchingEnabled = project.preview_branch_refs && project.preview_branch_refs.length > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

@joshenlim i suppose this only makes sense if default project is also counted in the preview_branch_refs array

Copy link
Member

Choose a reason for hiding this comment

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

yeah you're right - the api route for default project probably doesnt have this param hence why it crashed here

@Hallidayo
Copy link
Contributor Author

Hi @MildTomato & @joshenlim - I've just updated the change to use @joshenlim line.

@saltcod
Copy link
Contributor

saltcod commented Mar 19, 2024

@Hallidayo a quick conflict there & we should be g2g!

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.

4 participants