fix: Enable APSE (#20909)

* Revert some of the changes in 20982 and 20987.

* The default env for staging should be Singapore.
This commit is contained in:
Ivan Vasilov authored and GitHub committed 2024-01-31 23:17:12 +00:00
1 parent 5616dadf8c
commit eac073219a
3 files changed
+3 -14

No files matched your search

@@ -31,9 +31,6 @@ export const RegionSelector = ({
useEffect(() => {
// only pick a region if one hasn't already been selected
if (isSuccess && region && !selectedRegion) {
// [Joshen] TEMP FIX BLOCK APSE 1 ON PROD
if (process.env.NEXT_PUBLIC_ENVIRONMENT === 'prod' && region === 'Southeast Asia (Singapore)')
return
onSelectRegion(region)
} else if (isError && !selectedRegion) {
// if an error happened, and the user haven't selected a region, just select the default one for him
@@ -54,8 +54,7 @@ export const AVAILABLE_REPLICA_REGIONS: Region[] = Object.keys(AWS_REGIONS)
.map((key) => {
return {
key: key as AWS_REGIONS_KEYS,
// [Joshen] TEMP FIX BLOCK APSE 1 ON PROD, remove ternary
name: AWS_REGIONS?.[key as AWS_REGIONS_KEYS] ?? '',
name: AWS_REGIONS?.[key as AWS_REGIONS_KEYS],
region: AWS_REGIONS_VALUES[key],
coordinates: AWS_REGIONS_COORDINATES[key],
}
+2 -9
View File
@@ -1,5 +1,4 @@
import { components } from 'data/api'
import { IS_PLATFORM } from '.'
export type CloudProvider = 'FLY' | 'AWS'
export type Region = typeof AWS_REGIONS | typeof FLY_REGIONS
@@ -17,10 +16,7 @@ export const AWS_REGIONS = {
// 'North EU': 'North EU',
CENTRAL_EU: 'Central EU (Frankfurt)',
SOUTH_ASIA: 'South Asia (Mumbai)',
// [Joshen] TEMP FIX BLOCK APSE 1 ON PROD
...(process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod'
? { SOUTHEAST_ASIA: 'Southeast Asia (Singapore)' }
: {}),
SOUTHEAST_ASIA: 'Southeast Asia (Singapore)',
NORTHEAST_ASIA: 'Northeast Asia (Tokyo)',
NORTHEAST_ASIA_2: 'Northeast Asia (Seoul)',
OCEANIA: 'Oceania (Sydney)',
@@ -34,11 +30,8 @@ export const FLY_REGIONS = {
SOUTHEAST_ASIA: 'Singapore',
} as const
// [Joshen] TEMP FIX BLOCK APSE 1 ON PROD, remove as string
export const AWS_REGIONS_DEFAULT =
process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod'
? (AWS_REGIONS.SOUTHEAST_ASIA as string)
: AWS_REGIONS.WEST_US
process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod' ? AWS_REGIONS.SOUTHEAST_ASIA : AWS_REGIONS.WEST_US
// TO DO, change default to US region for prod
const FLY_REGIONS_DEFAULT = FLY_REGIONS.SOUTHEAST_ASIA