Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/2297.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refactor REACT_APP_SKIP_GRAPH to match other env booleans
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ REACT_APP_SHOW_BUILD_BANNERS=true
# REACT_APP_FIXED_NETWORK=testnet
# REACT_APP_FIXED_LAYER=sapphire
# REACT_APP_SKIP_GRAPH=true
REACT_APP_SKIP_GRAPH=false
REACT_APP_SHOW_FIAT_VALUES=true

# LOCALNET SETTINGS
Expand Down
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ REACT_APP_SHOW_BUILD_BANNERS=true
# REACT_APP_FIXED_NETWORK=testnet
# REACT_APP_FIXED_LAYER=sapphire
# REACT_APP_SKIP_GRAPH=true
REACT_APP_SKIP_GRAPH=false
REACT_APP_SHOW_FIAT_VALUES=true
2 changes: 1 addition & 1 deletion src/app/utils/route-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { orderByLayer } from '../../types/layers'

export const fixedNetwork = import.meta.env.REACT_APP_FIXED_NETWORK as Network | undefined
export const fixedLayer = import.meta.env.REACT_APP_FIXED_LAYER as Layer | undefined
export const skipGraph = !!fixedLayer || !!(import.meta.env.REACT_APP_SKIP_GRAPH as boolean | undefined)
export const skipGraph = !!fixedLayer || import.meta.env.REACT_APP_SKIP_GRAPH === 'true'

export type ScopeFreedom =
| 'network' // We can select only the network
Expand Down
6 changes: 3 additions & 3 deletions src/oasis-nexus/replaceNetworkWithBaseURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export const replaceNetworkWithBaseURL = <T>(
requestOverrides?: AxiosRequestConfig,
): Promise<AxiosResponse<T>> => {
if (config.url?.startsWith('/mainnet/')) {
config.url = config.url.replace('/mainnet/', import.meta.env.REACT_APP_API!)
config.url = config.url.replace('/mainnet/', import.meta.env.REACT_APP_API)
} else if (config.url?.startsWith('/testnet/')) {
config.url = config.url.replace('/testnet/', import.meta.env.REACT_APP_TESTNET_API!)
config.url = config.url.replace('/testnet/', import.meta.env.REACT_APP_TESTNET_API)
} else if (config.url?.startsWith('/localnet/')) {
config.url = config.url.replace('/localnet/', import.meta.env.REACT_APP_LOCALNET_API!)
config.url = config.url.replace('/localnet/', import.meta.env.REACT_APP_LOCALNET_API)
} else {
throw new Error(`Expected URL to be prefixed with network: ${config.url}`)
}
Expand Down
4 changes: 2 additions & 2 deletions src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare global {
REACT_APP_ENABLE_OASIS_MATOMO_ANALYTICS: string
REACT_APP_API: string
REACT_APP_TESTNET_API: string
REACT_APP_LOCALNET_API?: string
REACT_APP_LOCALNET_API: string
REACT_APP_SHOW_BUILD_BANNERS: 'true' | 'false'
REACT_APP_META_TITLE: string
REACT_APP_META_IMAGE: string
Expand All @@ -28,7 +28,7 @@ declare global {
REACT_APP_STAGING_URLS?: string
REACT_APP_FIXED_NETWORK?: string
REACT_APP_FIXED_LAYER?: string
REACT_APP_SKIP_GRAPH?: string
REACT_APP_SKIP_GRAPH: 'true' | 'false'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If these are not optional envs anymore shouldn't we update .env.production as well ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added

I still assume .env.production inherits from .env

REACT_APP_SHOW_FIAT_VALUES: 'true' | 'false'
REACT_APP_LOCALNET_CONSENSUS: 'true' | 'false'
REACT_APP_LOCALNET_SAPPHIRE: 'true' | 'false'
Expand Down
Loading