Skip to content

fix: fallback to 'default' region in project switcher dropdown for se… #2139

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

HarshMN2345
Copy link
Member

What does this PR do?

fix: prevent undefined region in project URLs

Add fallback to 'default' when project.region is undefined to prevent URLs like project-undefined-{id}. Fixes project creation and navigation across console components.

Test Plan

image image

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

Yes

@HarshMN2345 HarshMN2345 requested a review from ItzNotABug July 21, 2025 13:36
href: `${base}/project-${project.region}-${project.$id}/overview/platforms`
}));
const projectLinks = loadedProjects.projects.slice(0, 4).map((project) => {
const region = project.region || (!isCloud ? 'default' : project.region);
Copy link
Member

Choose a reason for hiding this comment

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

doesn't matter if cloud or not, if region isn't there, add it anyways. project.region ??= region.

@@ -341,7 +344,7 @@
<div use:melt={$itemProjects}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor
href={`${base}/project-${project.region}-${project.$id}/overview/platforms`}>
href={`${base}/project-${project.region || (!isCloud ? 'default' : project.region)}-${project.$id}/overview/platforms`}>
Copy link
Member

Choose a reason for hiding this comment

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

lets add project.region ??= region where the project is loaded so we don't have to do this manually everywhere.

Copy link
Member

Choose a reason for hiding this comment

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

same as above.

@HarshMN2345 HarshMN2345 self-assigned this Jul 22, 2025
@HarshMN2345 HarshMN2345 requested a review from ItzNotABug July 22, 2025 05:03
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