Skip to content

Conversation

stnguyen90
Copy link
Contributor

What does this PR do?

  1. initialize regions store as empty ConsoleRegionList to prevent undefined errors trying to access regions.regions.
  2. remove unnecessary regions fetch

Test Plan

Manually tested going to /console/onboarding/create-project

Before:

image

After:

image

Manually browsed from /console/account/organizations to an organization

Before:

image

After:

image

Related PRs and Issues

None

Have you read the Contributing Guidelines on issues?

Yes

@stnguyen90 stnguyen90 moved this to Code Review in 1.7 Release May 28, 2025
Using undefined as the initial value can lead to issues when trying to access the store such as:

TypeError: Cannot read properties of undefined (reading 'regions')
The regions store is populated elsewhere already so no need to do it again here.

Also, $organization may not be defined on mount which would lead to:

TypeError: Cannot read properties of undefined (reading '$id')
@stnguyen90 stnguyen90 force-pushed the fix-undefined-organization-id branch from 8b8f958 to e4c66b1 Compare May 28, 2025 00:28
@stnguyen90 stnguyen90 requested a review from ItzNotABug May 28, 2025 00:31
@ItzNotABug ItzNotABug merged commit a8a5727 into main May 28, 2025
2 checks passed
@ItzNotABug ItzNotABug deleted the fix-undefined-organization-id branch May 28, 2025 03:43
@github-project-automation github-project-automation bot moved this from Code Review to Done in 1.7 Release May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants